The Artima Developer Community
Sponsored Link

Python Answers Forum
pls..its urgent..copy a file from local to remote machine using ftp

1 reply on 1 page. Most recent reply: Jan 16, 2006 7:11 PM by Chad Gorshing

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
poli timisoara

Posts: 1
Nickname: poli
Registered: Nov, 2005

pls..its urgent..copy a file from local to remote machine using ftp Posted: Nov 9, 2005 7:29 AM
Reply to this message Reply
Advertisement
Hi,

I am newby in Python. I want to copy a file from a local machine with IP1 (for example) to a remote machine with IP2 for example.

I do:

import ftplib
f = ftplib.FTP(IP)
f.login(user,pwd)

and then I try to use ftpcp(). I do not know how to use it. Is there another way to copy the file besides using ftpcp()? Please answer with examples for a newby :)

Thank you very much!

Serban


Chad Gorshing

Posts: 12
Nickname: gorshing
Registered: Jun, 2004

Re: pls..its urgent..copy a file from local to remote machine using ftp Posted: Jan 16, 2006 7:11 PM
Reply to this message Reply
The signiture for ftpcp is as follows:

ftpcp (source, sourcename, target, targetname, type)


sourcename - which is the copy from filename
targetname - which is the copy to filename

I would suggest to ignore type, unless you are sure that you will need a text transfer, otherwise type is default to binary.

The source and target are both FTP objects.

Did you need an example?

Flat View: This topic has 1 reply on 1 page
Topic: What am I doing wrong? Previous Topic   Next Topic Topic: multiarray module not found

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use