httpsocket and online storage services

I’m trying to download a file from one of the online storage services (mediafire) using httpsocket and Curlsmbs but it seems that this service changes the url at the fly and the initial url like (it’s a non working sample):

http://www.mediafire.com/download/nxasc42ani7zla1/myfile.dmg
becomes
http://download1509.mediafire.com/yj7q4qezyfag/nxasc42ani7zla1/myfile.dmg once on the browser ( Chrome, Safari, etc) downloads manager.

The result is that the downloaded file with httpsocket or Curlsmbs is 0 bytes size, I assume due to not having found the correct file.

Unfortunately the second url is dynamically created for each download by the online storage service and I can’t get the appropiate url each time.

Any one is using such services and trying downloads with Xojo ?

You will need to do something like this.

curl -v -O -L http://www.mediafire.com/download/nxasc42ani7zla1/myfile.dmg -H “Keep-Alive: 302” -H “Connection: keep-alive”

You don’t need curl to do it, you can do it with HTTPSocket easily.

If the HTTPSocket response has the HTTPStatusCode 302 (or 3XX) then it is a redirect. Check the headers for the new link, it should have the name “Location”. Then once you get the new location, do another GET request and it should work.

Thanks so much for your help.

I have tried now with the Curlsmbs option “OptionFollowLocation” and seems to work. Will try now to get it also with HttpSocket.