local path = system.pathForFile( “hello.png”, system.DocumentsDirectory )
myFile = io.open( path, “w+b” )
– Request remote file and save data to local file
http.request{
url = “http://developer.anscamobile.com/demo/[filename].png”,
sink = ltn12.sink.file(myFile),
}
If I do the above in a loop condition, it will only EVER download and save the first file to the DocumentDirectory and all subsequent files will be created, but will be empty. According to my research, the http.request is synchronous, so this is very perplexing behavior.
Any help would be very appreciated, thanks =) [import]uid: 93100 topic_id: 22419 reply_id: 322419[/import]
