[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua-socket and jpegs
- From: Wesley Smith <wesley.hoke@...>
- Date: Wed, 29 Apr 2009 18:45:29 -0700
it works!
thanks,
wes
On Wed, Apr 29, 2009 at 6:19 PM, Diego Nehab <diego@tecgraf.puc-rio.br> wrote:
> Hi,
>
>> ok, I've got Lua socket up and running. Is it possible to download a
>> jpeg through a url like http://www.images.com/random.jpg through the
>> http interface? I'm not sure how to setup a sink for this kind of
>> case. Any pointers appreciated.
>
> It certainly is. You can save the data you receive to disk
> or do anything else you may want to with it. Something like
> this
>
> local s = http.request("http://www.images.com/random.jpg")
> local f = io.open("random.jpg", "wb")
> f:write(s)
> f:close()
>
> Can you try it?
>
> []s,
> Diego
>