Request for Network Download to Follow Redirections

Hi,
Could the network download and network request functions be modified to support redirections.

An example is try to download:
http://www.pheedo.com/e/13d8c17d1d6e1a51cae6ea8590e42166/36157_360x270.jpg

This redirects to an image on National Geographic, but using network download a blank file is returned.

Alternatively, is there a work around using multithreateded http sockets that will work for this on iPhone?

Cheers,

  • Will
    [import]uid: 61273 topic_id: 10770 reply_id: 310770[/import]

Further to this, if we could use the method “HEAD” on network.request that would allow us to get the redirect and manually handle it…the same as using LuaSockets:

r, c, h = http.request {method = “HEAD”,url = url}
if h.location ~= nil then
local newurl = h.location
end

I’d just use LuaSockets but it’s not asynchronous, so would love to see this built into your network capabilities.

Cheers,

  • Will [import]uid: 61273 topic_id: 10770 reply_id: 39263[/import]

Bump on this thread, can someone please confirm if this has indeed been added to the list of things to do? At the moment it’s impossible to determine if there’s a redirect on a URL or File, and since network.download doesn’t follow redirects it also never gets followed!

Cheers,

  • Will [import]uid: 61273 topic_id: 10770 reply_id: 46590[/import]

I haven’t tried this part of LuaSockets, but LuaSockets is included in Corona. (i am using a more esoteric feature, UDP multicast… and that works)

–MBK [import]uid: 5822 topic_id: 10770 reply_id: 48137[/import]