downloaded images are empty (0kb), no errors
Posted: Mon Jun 05, 2017 4:13 pm
I'm trying to download images from a server to a file.
- I can view the image(s) in chrome and chrome incognito, so there shouldn't be a problem with the server, here's an example //s3.amazonaws.com/appforest_uf/f1496548544475x140387106221169240/grilled_cheese_on_plate.jpg
- I can download the image via a get/post to the server which returns the base64encoded data. I base64decode it and put it in url binfile and it works. The problem is that post is a blocking operation so the whole stack and IDE lock up.
None of the non-blocking commands are working. I've tried load, put URL, and libURLDownloadToFile. Load doesn't seem to do anything. The other two create a file in the right place with the right name but it's empty (0kb)
try
-- load tImgUrl with message "checkDownloads"
-- libURLDownloadToFile tImgUrl,tNewFile,"checkDownloads"
put URL tImgUrl into URL ("binfile:" & tNewFile)
catch myErr
answer myErr
end try
Any thoughts on what might be going wrong? Why would all of these commands fail without even generating an error?
- I can view the image(s) in chrome and chrome incognito, so there shouldn't be a problem with the server, here's an example //s3.amazonaws.com/appforest_uf/f1496548544475x140387106221169240/grilled_cheese_on_plate.jpg
- I can download the image via a get/post to the server which returns the base64encoded data. I base64decode it and put it in url binfile and it works. The problem is that post is a blocking operation so the whole stack and IDE lock up.
None of the non-blocking commands are working. I've tried load, put URL, and libURLDownloadToFile. Load doesn't seem to do anything. The other two create a file in the right place with the right name but it's empty (0kb)
try
-- load tImgUrl with message "checkDownloads"
-- libURLDownloadToFile tImgUrl,tNewFile,"checkDownloads"
put URL tImgUrl into URL ("binfile:" & tNewFile)
catch myErr
answer myErr
end try
Any thoughts on what might be going wrong? Why would all of these commands fail without even generating an error?