- 论坛徽章:
- 0
|
回复 #12 flw 的帖子
filename= 'D:\\python\\2.pdf'
a=os.path.basename(filename)
原来那个需要文件名,不要路径, 终于成功了!!!
- *get* '220 Welcome\r\n'
- *resp* '220 Welcome'
- "****connected to host "192.168.1.128"
- *cmd* 'USER iislog'
- *put* 'USER iislog\r\n'
- *get* '331 Please specify the password.\r\n'
- *resp* '331 Please specify the password.'
- *cmd* 'PASS **************'
- *put* 'PASS **************\r\n'
- *get* '230 Login successful.\r\n'
- *resp* '230 Login successful.'
- *welcome* '220 Welcome'
- 220 Welcome
- *cmd* 'CWD /download/'
- *put* 'CWD /download/\r\n'
- *get* '250 Directory successfully changed.\r\n'
- *resp* '250 Directory successfully changed.'
- *cmd* 'TYPE A'
- *put* 'TYPE A\r\n'
- *get* '200 Switching to ASCII mode.\r\n'
- *resp* '200 Switching to ASCII mode.'
- *cmd* 'PORT 192,168,202,7,30,8'
- *put* 'PORT 192,168,202,7,30,8\r\n'
- *get* '200 PORT command successful. Consider using PASV.\r\n'
- *resp* '200 PORT command successful. Consider using PASV.'
- *cmd* 'LIST'
- *put* 'LIST\r\n'
- *get* '150 Here comes the directory listing.\r\n'
- *resp* '150 Here comes the directory listing.'
- -rwxrwxrwx 1 0 0 15839923 Feb 12 06:32 2.pdf
- *get* '226 Directory send OK.\r\n'
- *resp* '226 Directory send OK.'
- None
- *cmd* 'TYPE A'
- *put* 'TYPE A\r\n'
- *get* '200 Switching to ASCII mode.\r\n'
- *resp* '200 Switching to ASCII mode.'
- *cmd* 'PORT 192,168,202,7,30,9'
- *put* 'PORT 192,168,202,7,30,9\r\n'
- *get* '200 PORT command successful. Consider using PASV.\r\n'
- *resp* '200 PORT command successful. Consider using PASV.'
- *cmd* 'NLST'
- *put* 'NLST\r\n'
- *get* '150 Here comes the directory listing.\r\n'
- *resp* '150 Here comes the directory listing.'
- *get* '226 Directory send OK.\r\n'
- *resp* '226 Directory send OK.'
- ['2.pdf']
- D:\python\2.pdf uploading....
- *cmd* 'TYPE I'
- *put* 'TYPE I\r\n'
- *get* '200 Switching to Binary mode.\r\n'
- *resp* '200 Switching to Binary mode.'
- *cmd* 'PORT 192,168,202,7,30,10'
- *put* 'PORT 192,168,202,7,30,10\r\n'
- *get* '200 PORT command successful. Consider using PASV.\r\n'
- *resp* '200 PORT command successful. Consider using PASV.'
- *cmd* 'STOR 2.pdf'
- *put* 'STOR 2.pdf\r\n'
- *get* '150 Ok to send data.\r\n'
- *resp* '150 Ok to send data.'
- *get* '226 File receive OK.\r\n'
- *resp* '226 File receive OK.'
复制代码
[ 本帖最后由 caesarok 于 2009-2-12 14:53 编辑 ] |
|