3

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 if upload.bat and commands.txt get uploaded too.

2

2 Answers 2

9

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.

2
  • I 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
    Apr 22, 2014 at 20:01
  • unfortunately, with the Windows FTP client, you cant. You would have to use a 3rd party FTP program such as NcFTP - ncftp.com
    – Keltari
    Apr 22, 2014 at 20:06
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.

1
  • 1
    could I also automatically zip the folder? and how could I unzip it on the server?
    – Jonan
    Apr 22, 2014 at 20:01

Not the answer you're looking for? Browse other questions tagged .