Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-12-14
7
Medium Priority
?
228 Views
Last Modified: 2014-12-20
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.
0
Comment
Question by:Mike Miller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 2000 total points
ID: 40499537
to run ftp from command prompt, do:

1- create text file like myftp.txt that contains

myusername
mypassword
prompt
bin
cd /remotedir
mput *.*
bye
2- run below command

ftp -n -s:myftp.txt myserver
0
 

Author Comment

by:Mike Miller
ID: 40505158
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.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40506259
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.
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

Author Comment

by:Mike Miller
ID: 40508211
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:

 ss2.jpg
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40508592
ok, runt the ftp without -n
0
 

Author Closing Comment

by:Mike Miller
ID: 40511086
That did it. Thanks!
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40511245
welcome
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question