Upload the whole directory with FTP from the command line
28,442
Solution 1
You would use mput *.*
(multiple put).
You may need to use lcd
(local change directory), but not likely. I believe it defaults to the folder the command is run from.
Here is a list of commands you can use.
Solution 2
I'm not sure that the underlying FTP protocol provides for a recursive transfer of a directory. Your best bet is to zip it, send it, and then unzip the directory at the remote location.
Related videos on Youtube
Author by
Jonan
Updated on September 18, 2022Comments
-
Jonan over 1 year
I've got this
.bat
file:ftp -s:commands.txt
File commands.txt:
open www.domain.nl username password cd path/to/upload/to/ prompt
How can I now upload the folder where I ran the
.bat
to the server? It doesn't really matter ifupload.bat
andcommands.txt
get uploaded too.-
summea about 10 yearsNote: Depending on how you are using FTP, it might be a good idea to find alternatives to FTP at some point...
-
Ƭᴇcʜιᴇ007 about 10 years
-
-
Jonan about 10 yearsI just tested this, and it works fine for all the files directly in the current directory. However, it gives an error for subdirectories. How can I get this to work?
-
Jonan about 10 yearscould I also automatically zip the folder? and how could I unzip it on the server?
-
Keltari about 10 yearsunfortunately, with the Windows FTP client, you cant. You would have to use a 3rd party FTP program such as NcFTP - ncftp.com