Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm reading this site:

http://www.nsftools.com/tips/MSFTP.htm

But it's confusing and I'm not sure how to structure the command.

Basically I have a few text files I need to COPY from SERVER1 (internal server) to an FTP server (outside the company). Let's call the ftp location "ftp://xxx.xxx.xxx.xxx/Folder1"

Let's just use one file for this, called test.txt

The username and password for the FTP is u: bob p: bob123

How would I construct a copy command to this FTP that uses a username/password?

Source file location: C:\test.txt

Destination location: ftp://xxx.xxx.xxx.xxx/Folder1

Username: bob

Password: bob123

This is part of an automated process so there's no human intervention.

ftp ...

Thanks for the help.

share|improve this question
add comment

migrated from stackoverflow.com Dec 11 '12 at 1:18

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 0 down vote accepted

You can add the commands below to a script to get the functionality that you want. If you plan on scripting this I would recommend using variables for destination, filenames etc.

ftp <destination location> user <username> <password>
put <local filename> <filename on destination server>
bye

If you need to copy multiple files you can use mput -i as long as you can represent all the local files that need to be copied using an expression, for example, '*.c', to copy all c files.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.