使用 webrequest 发出移动 FTP 文件夹的重命名命令

发布于 2024-12-12 13:28:43 字数 345 浏览 4 评论 0原文

如何使用 FTP 在目录之间移动文件?

我试图使用 webrequest 对象移动文件夹,例如

move data/current

data/previous/1/

但是,当我尝试简单地通过将源文件夹设置为源、目标文件夹设置为目标来做到这一点时,我遇到了异常

请求 URI 对于此 FTP 命令无效。

我根本不应该这样做吗?我该如何巧妙地实现这个目标?

How can I use FTP to move files between directories?

I were trying to use the webrequest object to move a folder, say

move data/current

to data/previous/1/

however when i try to do it simply by setting source folder as source, target folder as destination, i have got the exception

The request URI is invalid for this FTP command.

should i not be doing that at all? how should i achieve this objective neatly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小镇女孩 2024-12-19 13:28:43

我发现当请求 URI 带有尾部斜杠(即使它是一个目录)时,我会收到此错误。尝试删除 data/previous/1/ 上的最后一个斜杠。

I have found that I get this error when the request URI has a trailing slash (even if it is a directory). Try removing the last slash on data/previous/1/.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文