[ftputil] server question

Valeriy Pogrebitskiy valeriy.pogrebitskiy at db.com
Thu Jun 17 20:11:14 MEST 2004


To connect to the server using different PORT than default ftp port, you need to define your own factory class that connects to arbitrary port... Here is what Stefan has in his documentation about this:


import ftplib
import ftputil

EXAMPLE_PORT = 50001

class MySession(ftplib.FTP):
    def __init__(self, host, userid, password, port):
        """Act like ftplib.FTP's constructor but connect to other port."""
        ftplib.FTP.__init__(self)
        self.connect(host, port)
        self.login(userid, password)

# try not to use MySession() as factory, - use the class itself
host = ftputil.FTPHost(host, userid, password,
                       port=EXAMPLE_PORT, session_factory=MySession)
# use `host` as usual


Stefan,

Correct if I am wrong... What I noticed though is that most procedures within <ftputil.FTPHost> class do not work as expected with DOCUMENTUM server.


Valeriy Pogrebitskiy
E-Mail:    vpogrebi at iname.com
Work:     (908) 608-3137


                                                                                                                                        
                      tyson                                                                                                             
                      <twenger at vltool.co        To:       ftputil at codespeak.net                                                         
                      m>                        cc:                                                                                     
                      Sent by:                  Subject:  [ftputil] server question                                                     
                      ftputil-bounces at co                                                                                                
                      despeak.net                                                                                                       
                                                                                                                                        
                                                                                                                                        
                      06/20/04 01:57 PM                                                                                                 
                                                                                                                                        
                                                                                                                                        




Hi-
  Im having trouble using the ftputil module to connect to a local
server.  I am using wx Python and want to transfer somes files from my
c:\  on a remote computer to one of our local server.  When I try to
connect to the server, I get an error.  This is how my code looks

import ftputil
import ftplib
host = ftputil.FTPHost('test.vltool.com', 'user', 'password', 5432)

After I try this I get an error stating:
None (10061, 'Connection Refused')

Is there anything you can suggest that might help??



_______________________________________________
ftputil mailing list
ftputil at codespeak.net
http://codespeak.net/mailman/listinfo/ftputil





--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.




More information about the ftputil mailing list