http.request problems downloading an image

I am having trouble with http.request when I attempt to download an image from a URL like this:

http://192.168.152.133:8080/vfs/special://masterprofile/Thumbnails/Video/a/a2cac38e.tbn

all I get in return in the file I sink to is a message stating

[html]

File not foundFile not found[/html] Sample code:

http.request{
url=“http://192.168.152.133:8080/vfs/special://masterprofile/Thumbnails/Video/a/a2cac38e.tbn
sink=ltn12.sink.file(a2cac38e.tbn)
}
Do I need to escape the above URL in some manner? The URL works fine in all browsers, but no luck with the http.request.
[import]uid: 36999 topic_id: 8027 reply_id: 308027[/import]

You use a link to a local server.
Do the device see this server? Perhaps, it tries to get the file through the internet… [import]uid: 42078 topic_id: 8027 reply_id: 28588[/import]

Thanks sidasa, but yes the device can see the server. The IP address I used above is not the real address I am using. It is just an example. The server is on a local network, and I am pulling other information from the server with no problems. I am just not able to download a picture with the app. I am able to browse to the picture with the same URL from the device. [import]uid: 36999 topic_id: 8027 reply_id: 28611[/import]

I have more information about the problem I am experiencing. I took a packet capture and found that even though the url is as posted here:

http.request{
url=“http://192.168.152.133:8080/vfs/special://masterprofile/Thumbnails/Video/a/a2cac38e.tbn
sink=ltn12.sink.file(a2cac38e.tbn)
}

what is being sent to the server is:

GET /vfs/special:/masterprofile/Thumbnails/Video/a/a2cac38e.tbn

As you can see the second / after special is missing in the actual call to the server. I have tried to escape the second / character but I keep getting the same problem (only one /).

I also just tried sending a partial URL encoding like this:

url=“http://192.168.152.133:8080/vfs/special%3A%2F%2Fmasterprofile/Thumbnails/Video/a/a2cac38e.tbn
but what is sent is:

GET /vfs/special:%2f%2fmasterprofile/Thumbnails/Video/a/a2cac38e.tbn

Is there another way I can attempt to download an image?
Anyone seen anything like this? Any ideas?
Any help would be appreciated.

[import]uid: 36999 topic_id: 8027 reply_id: 28794[/import]

Enough with my ramblings.

I have found the solution. I will share in case anyone else runs into this problem or something similar. After a lot of trial/error and research I have found that using the “socket.url” and “url.escape” I was able to escape the path part of my url;

vfs/special://masterprofile/Thumbnails/Video/a/a2cac38e.tbn

properly to get the code to download an image.

Here is about what I ended up with:

local url = require(“socket.url”)
path = “vfs/special://masterprofile/Thumbnails/Video/a/a2cac38e.tbn”
path = url.escape(path)
path = “http://192.168.152.133:8080/” … path
http.request{
url=path
sink=ltn12.sink.file(a2cac38e.tbn)
}

and now the image is downloaded properly. [import]uid: 36999 topic_id: 8027 reply_id: 28833[/import]