开发者

Can you force an FTP client to use binary from the server side

开发者 https://www.devze.com 2023-04-12 08:18 出处:网络
We have devices that run a proprietary FTP client on them. They retrieve media files (AVI videos and Images) as well as XML files from our web service utilizing a python based FTP server. The problem

We have devices that run a proprietary FTP client on them. They retrieve media files (AVI videos and Images) as well as XML files from our web service utilizing a python based FTP server. The problem I'm having is that the FTP client wants to download the media files in ASCII mode instead of binary mode. I'd like to continue to use our python FTP server (pyftpdlib) but I can't figure out a way to force the client to use binary mode开发者_高级运维.

I've skimmed through the FTP RFC looking for a command/response sequence that would allow our FTP server to tell the FTP client to use binary instead of ASCII. Does such a command/response sequence exist?


You can override the default behaviour or you ftp server by using a custom FTPHandler and overriding the FTPHandler.ftp_TYPE(filetype) method and this way force your server to serve file in binary mode self._current_type = "i".

0

精彩评论

暂无评论...
验证码 换一张
取 消