# Uploading Multiple Files in Terminal



## hinotoxin (Jan 17, 2006)

I am using the command "mput" in terminal because I want to upload a whole folder.
I typed mput, pressed return, then dragged the folder "gb" into the terminal and pressed return, then this line appeared: 

mput /Users/elizabethmclernon/Sites/gb/ [anpqy?]?

And I have no idea what to do next. If anyone could help it would be very appreciated. Thanks.


----------



## ElDiabloConCaca (Jan 18, 2006)

Don't drag the folder itself -- highlight all the files inside the folder, then drag the bunch of them to the terminal window.  All the pathnames should fill in, which is the correct syntax for mput...

It should be:


```
mput <file1> <file2> <file3> ... <fileN>
```


----------



## leonpmu (Jan 23, 2006)

Wouldn't mput -Rf work better??


----------



## hinotoxin (Jan 23, 2006)

leonpmu said:
			
		

> Wouldn't mput -Rf work better??



You mean just type 'mput -Rf' ?
I tried all of these things but still get this [anpqy?]
I don't know what that means.


----------



## spb (Jan 26, 2006)

According to the ftp man page: "Note: mget and mput are not meant to transfer entire directory subtrees of files.  That can be done by transferring a tar(1) archive of the subtree (in binary mode)."  

On your local machine you should be able to use tar:

tar -cf tared.file.name.tar <input files or wildcard>

then enter the ftp environment and upload the tar file using the put command in binary mode.

then within the ftp enviroment use the ! command to untar the files on the remote machine

ftp> !tar -xf tared.file.name.tar


----------

