22
7
I'm trying to use a cURL command to download a file from an FTP server to a local drive on my computer. I've tried
curl "ftp://myftpsite" --user name:password -Q "CWD /users/myfolder/" -O "myfile.raw"
But it returns an error that says:
curl: Remote file name has no length!
curl: try 'curl --help' or 'curl --manual' for more information
curl: (6) Could not resolve host: myfile.raw; No data record of requested type
I've tried some other methods, but nothing seems to work.
Also, I'm not quite sure how to specify which folder I want the file to be downloaded to. How would I do that?
Worked great. Not quite sure I fully comprehend how the %2f is used, as you're also using /, but hey it works, so I'm not gonna complain. Thanks for the help! – Josiah – 2011-04-01T19:44:47.463
1
@Josiah: It seems that the URL "path" is split by
– user1686 – 2011-04-01T19:51:43.377/
, and each argument is sent with aCWD
command:%2fusers/myfolder
asCWD /users
,CWD myfolder
. See RFC 1738 on this topic.