有没有办法强制 FTP 客户端在传输之前发出 ALLO 命令?
我正在开发一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为 @Rob Adams 的方向是正确的,但我不同意发送
552
,它表示您正在中止传输;我认为保留请求直到他们发送ALLO
是一种更有用的方法。通读 RFC 959:第 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 sendALLO
is a more useful approach. Reading through RFC 959: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 a350
and hold the transfer until either you get a session timeout, close or they send anALLO
.只是猜测 - 您可能会返回
552 - Exceeded storage allocate (for current directory or
为 STOR。数据集)。
Just a guess -- you could return
552 - Exceeded storage allocation (for current directory or
for the STOR.dataset).