有没有办法强制 FTP 客户端在传输之前发出 ALLO 命令?

发布于 2024-11-02 07:04:48 字数 113 浏览 7 评论 0原文

我正在开发一个 FTP 服务器,在 STOR 发生之前我需要文件大小,我看到有一个名为 ALLO 的命令,我想知道是否有一种方法可以强制客户端发出该命令,因为当然,客户端事先知道文件大小。

干杯。

I'm developing a FTP server, and I would need the file size before the STOR happens, I have seen that there is a command called ALLO, and I was wondering if there is a way to force the client to issue that command, because the client, of course, knows the file size before hand.

Cheers.

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

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

发布评论

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

评论(2

明媚殇 2024-11-09 07:04:48

我认为 @Rob Adams 的方向是正确的,但我不同意发送 552,它表示您正在中止传输;我认为保留请求直到他们发送 ALLO 是一种更有用的方法。通读 RFC 959

        This (ALLO) command may be required by some servers to reserve
        sufficient storage to accommodate the new file to be
        transferred...

第 4.2 节列出了回复,您可以在第一行显示错误,并在第二行详细说明 ALLO 的要求。

此外,第 4.2.2 节列出了此消息...350 请求的文件操作待进一步信息。

如果您的服务器在接收 < code>ALLO,它应该抛出 350 并保留传输,直到会话超时、关闭或他们发送 ALLO

I think @Rob Adams is going the right direction, but I disagree with sending 552, which says you are aborting the transfer; I think that holding the request until they send ALLO is a more useful approach. Reading through RFC 959:

        This (ALLO) command may be required by some servers to reserve
        sufficient storage to accommodate the new file to be
        transferred...

Section 4.2 lists the valid format of replies, where you can display the error on the first line, and elaborate on the requirement for ALLO on the 2nd line.

Furthermore, Section 4.2.2 lists this message... 350 Requested file action pending further information.

It seems reasonable that if your server receives a request to store before recieving an ALLO, it should throw a 350 and hold the transfer until either you get a session timeout, close or they send an ALLO.

与他有关 2024-11-09 07:04:48

只是猜测 - 您可能会返回 552 - Exceeded storage allocate (for current directory or
数据集)。
为 STOR。

Just a guess -- you could return 552 - Exceeded storage allocation (for current directory or
dataset).
for the STOR.

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