Is there a way to FTP-upload a whole directory tree?

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
1medic
Newbie
Posts: 7
Joined: Sat Apr 22, 2006 11:25 am

Is there a way to FTP-upload a whole directory tree?

Post by 1medic » Sun Apr 30, 2006 6:46 pm

Hi

I'm automating an FTP process and have tried MacroScheduler but also an excellent utility suggested here called MoveItFreely.

The problem I have with both is that I can't seem to FTP anything other than files.

With FlashFXP I'm used to FTPing entire directories and having the windows directory replicate on the web server.

Is there any way to do this automatically through batch file automation?

Or do I have to go to each directory on windows, make the same directory on the server, upload, and repeat?

thanks,

Luke

1medic
Newbie
Posts: 7
Joined: Sat Apr 22, 2006 11:25 am

Post by 1medic » Mon May 01, 2006 8:15 pm

OK I've found a way to do this - a tool called scriptftp.

It has a command for "putting" a directory - which saves lines and lines of code.

Luke

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue May 02, 2006 12:30 am

If I understand correctly you want to tell the ftp program to upload whatever is in a directory and if there are subdirectories in that directory then the ftp program should create those subdirectories if they don't exist on the server and then put the files into those subdirectories - right?

Are you thinking of the SYNC command in scriptftp?

1medic
Newbie
Posts: 7
Joined: Sat Apr 22, 2006 11:25 am

Post by 1medic » Tue May 02, 2006 9:45 am

Me_again wrote:If I understand correctly you want to tell the ftp program to upload whatever is in a directory and if there are subdirectories in that directory then the ftp program should create those subdirectories if they don't exist on the server and then put the files into those subdirectories - right?
That's exactly right.
With other command line FTP software I've seen you have to first know all sub directories in your installation. Then for each sub directory you'd write:

lcd local_sub_directory
mkdir remote_sub_directory
cd remote_sub_directory
put *.*

Scriptftp reduces this to one command:
PUTFILE("C:\directory\*.*",SUBDIRS)

I used it to complete my ftp automation yesterday, and it works.

Luke

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts