通过wget从ftp服务器下载文件失败 [英] downloading file from ftp server via wget fails
本文介绍了通过wget从ftp服务器下载文件失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用wget从FTP服务器下载文件。如果我输入
ftp://用户名:password@datatransfer.cj.com/some_path/file
进入我的浏览器,该文件被下载正常。
我相反,
wget ftp:// username:password@datatransfer.cj.com/some_path/file -O / path /file.txt
它表示登录不正确。
谢谢!
解决方案
如果用wget发送请求,你需要对密码中的特殊字符进行十六进制编码。
我从以下页面找到了这个:
https://www.smartftp.com/support/kb/url-that-contains-in-password -f187.html
I am downloading a file from an FTP server using wget. If I type in
ftp://username:password@datatransfer.cj.com/some_path/file
into my browser, the file is downloaded fine.
If I instead do,
wget ftp://username:password@datatransfer.cj.com/some_path/file -O /path/file.txt
It says login incorrect.
What are some possible reasons this may occur and how can I fix it.
Thanks!
解决方案
Turns out you need to hex encode special characters in the password if sending the request with wget.
I found this from the following page:
https://www.smartftp.com/support/kb/url-that-contains-in-password-f187.html
这篇关于通过wget从ftp服务器下载文件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文