Needed: FTP Upload Directory Tree script

I

IanC

Hi,

Does anyone know of a function or script to upload an entire
subdirectory tree from a local file space to an FTP server?

The Python distribution comes with "ftpmirror.py", which performs
a mirror download of a directory tree, but I need the "Upload"
version of this.

Thanks for any hints
 
K

kyosohma

Hi,

Does anyone know of a function or script to upload an entire
subdirectory tree from a local file space to an FTP server?

The Python distribution comes with "ftpmirror.py", which performs
a mirror download of a directory tree, but I need the "Upload"
version of this.

Thanks for any hints

Here's some links that should give you some pointers:

http://zephyrfalcon.org/weblog/arch_d7_2003_06_28.html#e262
http://www.example-code.com/python/python-ftp-upload.asp
http://www.thescripts.com/forum/thread22534.html

Mike
 
S

Stefan Schwarzer

Hello Ian,

Does anyone know of a function or script to upload an entire
subdirectory tree from a local file space to an FTP server?

The Python distribution comes with "ftpmirror.py", which performs
a mirror download of a directory tree, but I need the "Upload"
version of this.

I'm just working on an ftputil[1] extension[2] to copy/mirror
directory trees between local filesystems and remote FTP hosts.
It's in pre-alpha state (just in development), but maybe it
already does what you want. Did I note that this is an only
slightly tested module and might destroy your files? - That is,
use it at your own risk. I recommend you look at the source
code of ftp_sync.py before using it.

It works like this:

- Download[3] and install ftputil.

- Download the file[2] and put it into the site-packages/ftputil
directory.

- Use the library like:

import ftputil
from ftputil import ftp_sync

source = ftp_sync.LocalHost()
target = ftputil.FTPHost(hostname, username, password)
syncer = ftp_sync.Syncer(source, target)
syncer.sync(source_directory, target_directory)

Note that the _contents_ of source_directory (_not_ the directory
itself) will be copied to the already-existing target_directory.

If you have further questions or feedback, please send e-mail
to the ftputil mailing list[4] or to me[5].

[1] http://ftputil.sschwarzer.net
[2] http://ftputil.sschwarzer.net/trac/browser/trunk/ftp_sync.py?format=txt
[3] http://ftputil.sschwarzer.net/trac/wiki/Download
[4] mailto:[email protected]
[5] mailto:[email protected]

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top