I can download a file by url but when I try it from bash I get a html page instead of a file.
How to download file with url redirection (301 Moved Permanently) using curl, wget or something else?
UPD
Headers from the url request.
curl -I http://www.somesite.com/data/file/file.rar
HTTP/1.1 301 Moved Permanently Date: Sat, 07 Dec 2013 10:15:28 GMT Server: Apache/2.2.22 (Ubuntu) X-Powered-By: PHP/5.3.10-1ubuntu3 Location: http://www.somesite.com/files/html/archive.html Vary: Accept-Encoding Content-Type: text/html X-Pad: avoid browser bug
The Redirect method is the most straight forward of the two, and works by telling the user's browser the location of the file, and it then starts the process of downloading it directly from the server.
Use -L, --location
to follow redirects:
$ curl -L http://httpbin.org/redirect/1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With