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.

You can upload a single file with wput:

wput file ftp://username:passwd@ipaddress/file

is there a way to upload multiple? Maybe something like:

wput {file1,file2} ftp://username:passwd@ipaddress/{file1,file2}

Note: I know there are solutions using ftp, curl, and others. I was wondering if there is one for wput.

share|improve this question
add comment

migrated from stackoverflow.com May 2 '13 at 10:34

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

1 Answer

up vote 3 down vote accepted

RTFM

So you can specify e.g. one URL and read all filenames from a file. 
Or use wput *.txt ftp://host, to transfer all *.txt-files. 
See EXAMPLES for further examples.

−i file

−−input−file=file

Reads URLs and filenames from file. If there are URLs on the command-line too, these will be retrieved first, unless sorting is enabled. See also the URL-Input-Handling section. If file is −, the URLs will be read from stdin. If you want to pipe the contents of the file that shall be uploaded to stdin, this cannot be done (yet). But you can use the --input-pipe flag and read the contents a) from a named pipe -I "cat named.pipe; echo > /dev/null" or b) directly from the command, that outputs the data. (See --input-pipe) Do not do things like find | wput ftp://host/ −i −! Wput would upload all files from the current directory (since the first output of find will be ’.’) and afterwards each file again (since find postes its name to Wput. And further problematic is that Wput will upload each directory that is given by find and since find itself recurses all directories, the files would be uploaded three times (or even more often for further subdirectories). Use wput ftp://host/ to upload everything from the local directory. Or use find ! −type d | wput ftp://host/ −i − to tell find, not to output directories.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.