Problems with FTP

Thomas Jollans thomas at jollybox.de
Fri Jan 21 12:05:51 EST 2011


On Friday 21 January 2011, it occurred to RizlaJ to exclaim:
> Hi all, I'm very new to python. I'm using Python 2.7, in a corporate
> environment, therefore am behind a proxy server, firewalls etc.
> 
> I can ftp to a barclays capital ftp site ok in internet explorer, but
> I can't get the FTP from ftplib to work for me. Can someone please
> help!

It sounds very much like, as you said, you're behind a proxy, and have to use 
that proxy to connect to the FTP server. If you don't know the proxy settings, 
you might be able to find them in the IE configuration, or ask the local 
sysadmin.

http://stackoverflow.com/questions/1293518/proxies-in-python-ftp-application

It looks like you will have to ftp to the proxy server. Depending on the 
application, you might be able to use urllib2 instead.

Thomas

> 
> I've tried the following commands from my home personal machine
> (thefore no proxies etc) and the commands work fine and I'm able to
> enter my username and password and login successfuly - however in teh
> corporate environment I can't. I'm wondering if this is soemthing to
> do with security permissioning at work etc?
> 
> At the shell I'm typing:-
> 
> >>> from ftplib import FTP
> >>> ftp = FTP('indexftp.barcap.com')
> 
> and get the following error:
> Traceback (most recent call last):
>   File "<pyshell#19>", line 1, in <module>
>     ftp = FTP('indexftp.barcap.com')
>   File "C:\Python27\lib\ftplib.py", line 117, in __init__
>     self.connect(host)
>   File "C:\Python27\lib\ftplib.py", line 132, in connect
>     self.sock = socket.create_connection((self.host, self.port),
> self.timeout)
>   File "C:\Python27\lib\socket.py", line 571, in create_connection
>     raise err
> error: [Errno 10060] A connection attempt failed because the connected
> party did not properly respond after a period of time, or established
> connection failed because connected host has failed to respond
> 
> I wasn't expecting this error message next, i was expecting to be able
> to log on using the followign command :-
> 
> >> ftp.login("username","password")
> 
> Please help!
> 
> thanks!



More information about the Python-list mailing list