FTP/FTPS
正常的FTP上传

会话过程
220 FTP Server ready. USER ftpseven 331 Password required for ftpseven PASS 6yhn^YHN 230 User ftpseven logged in CWD ftp_path_cam 250 CWD command successful TYPE I 200 Type set to I PASV 227 Entering Passive Mode (192,168,24,254,249,63). STOR ftp-test 150 Opening BINARY mode data connection for ftp-test 226 Transfer complete QUIT 221 Goodbye.
密码错误示例,正确密码应该为6yhn^YHN,实际输入密码为^YHN6yhn

会话过程
220 FTP Server ready. USER ftpseven 331 Password required for ftpseven PASS 6YHN^yhn 530 Login incorrect. QUIT 221 Goodbye.
上传文件失败示例,这是camera的一个bug,FTP Path没有带"/"就读取值失败,没有拼接到路径里去;
# 问题原因


会话过程
220 (vsFTPd 3.0.3) USER ftpseven 331 Please specify the password. PASS 6yhn^YHN 230 Login successful. CWD ftp_path_cam 250 Directory successfully changed. CWD ftp_path_cam 550 Failed to change directory. TYPE I 200 Switching to Binary mode. PASV 227 Entering Passive Mode (192,168,24,254,242,86). # 这个路径不存在,正确的应为:192.168.24.76/ftp_path_cam/20260921/20260921120053_Channel(1)_MotionDetectionAlarm_1.jpg STOR 192.168.24.76/20260921/20260921120053_Channel(1)_MotionDetectionAlarm_1.jpg 553 Could not create file. QUIT 221 Goodbye.
按照开发的代码填写FTP Path,就可以正常上传,兼容性bug,开发只需要做一个判断若没有斜杠则增加斜杠就可以解决这个兼容问题。


浙公网安备 33010602011771号