DOS FTP Commands (found in Win95 Reskit) (see end also) ........................................ ( Revised and enhanced by C.B. Falconer from a version at: ) d:>ftp --help gives help on command line arguments, as follows: Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively. FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [-A] [host] -v Suppresses display of remote server responses. -n Suppresses auto-login upon initial connection. -i Turns off interactive prompting during multiple file transfers. -d Enables debugging. -g Disables filename globbing (see GLOB command). -s:filename Specifies a text file containing FTP commands; the commands will automatically run after FTP starts. -a Use any local interface when binding data connection. -A login as anonymous. -w:buffersize Overrides the default transfer buffer size of 4096. host Specifies the host name or IP address of the remote host to connect to. When running, the following are available: help Displays DOS FTP help. ? Displays DOS FTP help. ascii Sets transfer mode to ASCII (for text files and HTML pages). binary Sets transfer mode to BINARY (for graphics and sound files). cd Changes working directory on the remote computer. delete Deletes files on the remote computer. disconnect Breaks the ftp connection but keeps FTP client open. get Copies a remote file to the local computer using the current file transfer type (the local dir is the one your launched FTP in or changed to with the lcs command). lcd Changes the working directory on the local computer. ls Displays list of remote directory's files and sub-directories. mdelete Multiple delete of files. mget Copies multiple remote files to local computer. mkdir Creates a remote directory. mput Copies multiple local file to the remote computer. put Copies a local file to the remote computer. rename Renames remote files. rmdir Deletes a remote directory. type Sets or displays the file transfer type. ! (bang) enter shell commands until "exit" !cmd Execute "cmd" in the shell and return. Example: !dir ~~~~~~~~~~~~-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Uploading into a Sub-directory. If I you have a sub-dir named "images" type cd images put my.gif put your.gif and so on for each graphic file. You move around the directories in FTP like you would at the DOS command line. By default filename "globbing" is on. This means you can use wildcards in local file and path names. To upload all .gif files to your images directory type cd images mput *.gif This should upload all gifs to your current remote working directory from your current local working directory. BTW you can disconnect without exiting FTP by typing disconnect. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ What is the best way to get a lot of html files and graphics to a sub-directory of my PWP directory using DOS FTP? Use mput. It uploads multiple *files* mput *.gif will upload all your gifs to your remote working directory. It will ask Y/N for each file unless you turn it off by typing "prompt" (the command toggles on/off). Sometimes, typing mput *.gif is a lot more satisfying than point--shift-select-click-select...of a graphical FTP program. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ How do I get a DOS-Prompt Window and Start FTP? 1. Create a dos-prompt Window (Start Menu, select DOS Prompt). 3. Change your PC's directory to the directory that contains the file you wish to upload (ie "cd a:\") 4. Type "ftp" at the dos prompt and press enter 5. Type "open upload.att.net" and press enter 6. Type in your email-id (do not include the @worldnet.att.net part) and press enter 7. Enter your security_word (not your email password) and press enter 8. Type "binary" to select binary mode transfer and press enter 9. Type "put filename.jpg" (to upload your file a:\filename.jpg) and press enter 10.Repeat as necessary 11.Type "bye" and press enter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hints. If you don't want various line endings altered, use binary transfers. DOS FTP may be launched by a batch file and given a script to run. Make a ftpatt.bat with ftp -s:todo.txt upload.att.net Then make a FTP script todo.txt with your list of commands. [emailid] [password] binary mput *.html mput *.jpg bye All FTP commands are available. Note: you can also put "open upload.att.net" in as the first script command. My own script reads: open upload.att.net [emailid] [password] binary ls -l and after that runs I am ready to do any interactive operations. By default the ftp client works from your current DOS directory. Therefore, change to the directory where you keep your web pages before connecting. Then you only have to type put filename.html etc. You can get a listing of files by typing ls. Next, if you have subdirectories on your site you will have to cd while connected to your directory where you want to upload. The tricky part is when you want to be in the corresponding working directory on both remote and local site. You have to issue a lcd command to the local directory, then a cd command to the remote directory, then you are lined up to do the put. It's tough navigating at the command line, that is why the graphical FTP clients show two panes, one for the local directory and one for the remote directory. Q: When I am using FTP in Windows, I have no problem logging on or uploading. But how do I get back to the root directory for my pages. Or find the files I want to upload once I've started FTP? A: It can be easier to change to the proper directory that you want to upload to prior to starting FTP. But if you learn how to change your local directory, you will have more control over your session. If you started FTP in your /webpages/ directory on your hard disk, but wanted to upload some GIF's from your /images/ directory, you would issue a lcd images command. It means Local Change Directory. With this command you may start your FTP session in any directory. From RFC 640, "Revised FTP result codes": NWG/RFC# 640 JBP NJN 5-JUN-74 16:07 Neigus FTP Reply Codes [7] 125 Data connection already open; transfer starting 225 Data connection open; no transfer in progress 425 Can't open data connection On some systems, the 425 error results from a failed BSD connect(). This can result from network congestion (dropped packets), causing the DATA connect to fail, but leaving the CONTROL connection intact (remember, FTP uses a continuous control connection, and transient DATA connections). 200 type set to I is an informational message confirming BINARY mode. Lines beginning with 200 are system messages. Lines starting with 230 are for custom messages from the site administrator. 200 Command okay 11i1 500 Syntax error, command unrecognized [This may include errors such as command line too long.] 11i2 501 Syntax error in parameters or arguments 11i3 202 Command not imlemented, superfluous at this site. 11i4 502 Command not implemented 11i5 503 Bad sequence of commands 11i6 504 Command not implemented for that parameter 11i7 11j 110 Restart marker reply. In this case the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm where yyyy is User-process data stream marker, and mmmm is Server's equivalent marker. (note the spaces between the markers and "=".) 11j1 211 System status, or system help reply 11j2 212 Directory status 11j3 213 File status 11j4 214 Help message (on how to use the server or the meaning of a particular non-standard command. This reply is useful only to the human user.) 11j5 11k 120 Service ready in nnn minutes 11k1 220 Service ready for new user 11k2 221 Service closing TELNET connection (logged off if appropriate) 11k3 421 Service not available, closing TELNET connection. [This may be a reply to any command if the service knows it must shut down.] 11k4 NWG/RFC# 640 JBP NJN 5-JUN-74 16:07 30843 Neigus FTP Reply Codes [7] 125 Data connection already open; transfer starting 11k5 225 Data connection open; no transfer in progress 11k6 425 Can't open data connection 11k7 226 Closing data connection; requested file action successful (for example, file transfer or file abort.) 11k8 426 Connection trouble, closed; transfer aborted. 11k9 227 Entering [passive, active] mode 11k10 11l 230 User logged on, proceed 11l1 530 Not logged in 11l2 331 User name okay, need password 11l3 332 Need account for login 11l4 532 Need account for storing files 11l5 11m 150 File status okay; about to open data connection. 11m1 250 Requested file action okay, completed. 11m2 350 Requested file action pending further information 11m3 450 Requested file action not taken: file unavailable (e.g. file not found, no access) 11m4 550 Requested action not taken: file unavailable (e.g. file busy) 11m5 451 Requested action aborted: local error in processing 11m6 452 Requested action not taken: insufficient storage space in system 11m7 552 Requested file action aborted: exceeded storage allocation (for current directory or dataset) 11m8 553 Requested action not taken: file name not allowed 11m9 354 Start mail input; end with . 11m10 from RFC 640 Revised FTP Error Codes http://rfc.fh-koeln.de/rfc/html/rfc0640.html ........................................ Another useful alternative is curl, by Daniel Stenburg, which is free, open source software, and portable to many systems. It is available at: or (cURL stands for command-line URL and can be used for many things) For webpage maintenance the -T (for Transfer) option should be useful. I suggest maintaining your site with ftp until you find you are often doing the same things. You could then capture this in single a cURL command line.