Monday, October 16, 2006

FTP Upload Files Through Windows DOS Prompt

FTP Upload Files Through Windows DOS Prompt

Listing a huge list of directories and files from a server in a FTP client can be time consuming. This solution involves uploading files directly through the Windows FTP program.

To upload files to the server without a FTP client, create the following two files in the d:\ftp directory:

upload-ftp.bat (copy and paste the contents below)

d:\
cd ftp
ftp -s:files.txt
(Note: d: is the drive where these two files are located)

files.txt (copy and paste the contents below)
open server-name.com
username
password
bin
prompt
cd /var/www/remotedir
send file1.zip
send file2.zip
send file3.zip
send file4.zip
quit

Double click to run the file upload-ftp.bat. The zip files to be uploaded need to be in the same directory (d:\ftp\ in this case) as the two files above.

Note: Ensure that the remote directory exists before uploading the files.

No comments: