Starting with pyftpdlib

602 views
Skip to first unread message

Iván González Cano

unread,
Nov 13, 2012, 10:32:22 AM11/13/12
to pyft...@googlegroups.com
Hi,

I just wanted to send a file from one PC to another. I launched "basic_ftpd.py" script and it says "Starting FTP server". I don't see any client example. Is there any for sending a file?

Kind regards,

Iván

Andrew Scheller

unread,
Nov 13, 2012, 10:59:32 AM11/13/12
to pyft...@googlegroups.com
> I just wanted to send a file from one PC to another. I launched
> "basic_ftpd.py" script and it says "Starting FTP server". I don't see any
> client example. Is there any for sending a file?

Take your pick! ;-)
http://www.google.com/search?q=FTP+client

Or, if you want to script something in Python:
http://docs.python.org/2/library/ftplib.html

Unless I've misunderstood your question...?

Andrew

Iván González Cano

unread,
Nov 13, 2012, 11:14:39 AM11/13/12
to pyft...@googlegroups.com
I use this code in Python:

import ftplib

s = ftplib.FTP('localhost','user','12345') # Connect
 
s.quit()

but I get:

Traceback (most recent call last):
  File "C:\Users\ivan.gonzalez\Desktop\workcopy-LEW\trunk\Feve\workspace\PyFTP\src\FTP_Client.py", line 3, in <module>
    s = ftplib.FTP('localhost','user','12345') # Connect
  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
socket.error: [Errno 10061] No se puede establecer una conexión ya que el equipo de destino denegó expresamente dicha conexión

Iván González Cano

unread,
Nov 13, 2012, 11:16:54 AM11/13/12
to pyft...@googlegroups.com
And using Filezilla:

Estado:    Conectando a 127.0.0.1:21...
Estado:    Falló intento de conexión con "ECONNREFUSED - Connection refused by server".
Error:    No se pudo conectar al servidor
Estado:    Esperando para reintentar...
Estado:    Retrasando conexión por 1 segundo debido a un intento previo de conexión fallido...
Estado:    Conectando a 127.0.0.1:21...
Estado:    Falló intento de conexión con "ECONNREFUSED - Connection refused by server".
Error:    No se pudo conectar al servidor

It is like the server doesn't let me access. The server code is "basic_ftpd.py".

Giampaolo Rodolà

unread,
Nov 13, 2012, 11:27:56 AM11/13/12
to pyft...@googlegroups.com
2012/11/13 Iván González Cano <ivangonz...@gmail.com> wrote:
> socket.error: [Errno 10061] No se puede establecer una conexión ya 
> que el equipo de destino denegó expresamente dicha conexión

The server is either not running or running on a different port (!= 21).
Also, please make some research before posting here.
It would have taken a couple of minutes to understand that pyftpdlib is the server, ftplib is the client, etc.

> I don't see any client example. Is there any for sending a file?

Again, please use some Google:
This is not the right place where to look for FTP client examples.

- G.

Iván González Cano

unread,
Nov 13, 2012, 11:42:04 AM11/13/12
to pyft...@googlegroups.com
I knew that pyftpdlib was the server but I didn't know about ftplib, sorry. The port was ok, i change the IP to "127.0.0.1" instead of "0.0.0.0" and I worked with the ftplib client. I will now do some test sending files.

Thanks for the help.
Reply all
Reply to author
Forward
0 new messages