How do I download a file retrieved via a GET request? I tried wget http://www.example.com/?page=download&dl=123 and wget http://www.example.com/dl.php?dl=123, but they don't work. Going to the URLs in a browser works fine, but wget and curl don't. How can I download the file from the command-line?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|
||||
closed as too localized by Michael Mrozek♦ Feb 9 '12 at 14:40
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.
?a=b&c=dformat is GET. POST sends data hidden in the request, not the URL. – Kevin Feb 9 '12 at 4:18curl: stackoverflow.com/a/2348370/900873 – Kevin Feb 9 '12 at 4:24?and&are usually special to the shell. (Really, "doesn't work" is a little unspecific.) – Ulrich Schwarz Feb 9 '12 at 5:33--trust-server-nameshelps. I never tried it (but I will, next time I have this issue) — according to the man page, it trusts the server-provided filename, which is what you want. Whether that is secure or not, I don't know, let's hopewgetdoes some sanity check before using the name. – njsg Feb 9 '12 at 10:37