ftplib and FTP Objects...

Daniel Dittmar daniel.dittmar at sap.com
Fri Apr 12 07:34:41 EDT 2002


>   File "C:\Utils\Python21\lib\ftplib.py", line 273, in ntransfercmd
>     host, port = parse227(self.sendcmd('PASV'))
>   File "C:\Utils\Python21\lib\ftplib.py", line 229, in sendcmd
>     return self.getresp()
>   File "C:\Utils\Python21\lib\ftplib.py", line 202, in getresp
>     raise error_perm, resp
> ftplib.error_perm: 500 Unrecognized command

It seems as if the FTP server doesn't know the PASV command. You could try
def set_pasv(self, val):
        '''Use passive or active mode for data transfers.
        With a false argument, use the normal PORT mode,
        With a true argument, use the PASV command.'''
to use normal instead of passive mode.

You should also pass the open file to storbinary instead of the read method.

Daniel






More information about the Python-list mailing list