Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--remote-name doesn't honor the filename after redirect with --location #1241

nodakai opened this issue Feb 3, 2017 · 1 comment


Copy link

nodakai commented Feb 3, 2017

I did this

$ curl -LOJ -v
< Location:
Warning: Remote filename has no length!
* Failed writing body (0 != 2675)
  0 1772k    0  2675    0     0   2008      0  0:15:03  0:00:01  0:15:02  2008
* Closing connection 1
curl: (23) Failed writing body (0 != 2675)

I expected the following

Successfully download shellcheck-0.4.5-1-x86_64.pkg.tar.xz

curl/libcurl version

$ curl -V
curl 7.48.0-DEV (x86_64-unknown-linux-gnu) libcurl/7.48.0-DEV OpenSSL/1.0.1e zlib/1.2.3 libidn/1.18

operating system

$ uname -r
$ cat /etc/system-release
CentOS release 6.6 (Final)

Copy link

bagder commented Feb 3, 2017

This works as designed in order to not cause surprises if the site would redirect the URL to a file name that you might already use in your current directory. The man page explains this:

The remote file name to use for saving is extracted from the given URL, nothing else

We could possibly consider -J to ask for this to be handled as you suggest, but it isn't currently and I think I consider that more of a missing feature than an actual bug or problem.

@jay jay added the enhancement label Feb 3, 2017
@bagder bagder closed this as completed in c2127b4 Feb 15, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

No branches or pull requests

3 participants