gpt4 book ai didi

CURL命令行工具-从FTP服务器删除文件

转载 作者:行者123 更新时间:2023-12-03 20:27:26 27 4
gpt4 key购买 nike

我实际上正在尝试使用CURL在带有Visual Studio的C++中的ftp服务器上进行一些操作。我可以很轻松地使用命令行工具进行一些上载或下载。

但是对于删除某些文件,我有一些错误。

这是我键入的命令:

curl -v -u username:pwd ftp://host/FileTodelete.xml -Q '-DELE FileTodelete.xml'

这是答案:
* Adding handle: conn: 0x1ca5260
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1ca5260) send_pipe: 1, recv_pipe: 0
* About to connect() to host port 21 (
* Trying ......
* Connected to host (...) po
< 220-FileZilla Server version 0.9.49 beta
< 220 Bienvenue sur le serveur FTP de HandTrainer
> USER username
< 331 Password required for username
> PASS pwd
< 230 Logged on
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> '-DELE
* ftp_perform ends with SECONDARY: 0
< 500 Syntax error, command unrecognized.
* QUOT command failed with 500
* Closing connection 0
curl: (21) QUOT command failed with 500
* Rebuilt URL to: FileTodelete.xml'/
* Adding handle: conn: 0x1ca5260
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 1 (0x1ca5260) send_pipe: 1, recv_pipe: 0
* Could not resolve host: FileTodelete.xml'
* Closing connection 1
curl: (6) Could not resolve host: FileTodelete.xml'

而且,该文件在服务器上,所以我听不懂。

最佳答案

问题解决了! DELE之前的破折号不应存在:

curl -v -u username:pwd ftp://host/FileTodelete.xml -Q "DELE FileTodelete.xml"

关于CURL命令行工具-从FTP服务器删除文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28721515/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com