Link to home
Start Free TrialLog in
Avatar of Member_2_1242703
Member_2_1242703

asked on

How do I transfer all files from a local directory to a web server directory via FTP / command line?

I want to create a batch file that will move all files on my local PC to a folder on my web server using FTP with no prompts. How do I do this? Both systems are windows based.
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_1242703
Member_2_1242703

ASKER

Do these values change? If so, what are they?
prompt
bin
cd /remotedir
mput *.*
bye

Where do I run that command? I tried from a command prompt and it told me ftp was not a recognized command.
what version of windows?

I have windows 7 and ftp works from command prompt (cmd).

prompt is and ftp client command to disable / enable confirmation when transferring multiple files.

bin is an ftp client command to set file type to binary
cd is an ftp client command to change dir on the remote system
mput is an ftp client to send multiple files to remote system (or you could use put for single file, or mget to get multiple files from remote system).
bye is an ftp client command to exit ftp client.
ok I got it to work. I guess there is an environment variable screwed up or something. anyhow...here is myphp.txt

myUser
myPass
prompt
bin
cd /secure/projectfiles
mput C:\Stuff\FTPtest\files\*.*
bye

then I ran this command:
ftp.exe -n -s:C:\Stuff\FTPtest\myftp.txt ftp.mydomain.com

and received the following:

 User generated image
ok, runt the ftp without -n
That did it. Thanks!
welcome