Upload a file to an FTP site
FTPupload localfile ftpspec [.ext]
The FTPUPLOAD program can be used to upload a file to an FTP site. It is intended for use in postprocessing where it may be necessary to upload files for further processing. The localfile parameter must be a full pathname, optionally with wildcards in the filename part. If the pathname contains blanks, it must be enclosed in double-quotes.
The ftpspec parameter (enclosed in double-quotes if it contains blanks) comprises a number of required and optional components in the following sequence:
| filetype | the prefix ftp:// is required. |
| login | A login name and password, separated by a colon (:) and followed by an at sign (@) is required. The password may also contain an @, which is often the case with anonymous login. |
| host | The name of the FTP server is required. |
| port | An optional port number may be given, preceded by a colon (:). The default port number is 21. |
| path | A path is required. To save in the root of the FTP site, use a single forward slash (/). The path must use forward slash characters, not backslash, and must always end in a forward slash. Note that the pathname may be case-sensitive at some FTP servers. |
| filename | An optional filename may be given. If omitted, the filename of the source file is used. The filename must be omitted if the localfile contains wildcard characters. |
The optional .ext parameter contains a file extension (with leading .) which will be used to rename the local file if the transfer is successful. This can be used to prevent a second transfer if the upload is re-run with the same local file specification.
The program is a console mode program and so does not terminate until the transfer is complete. A status window is displayed during operation. If the transfer fails, a non-zero errorlevel is returned, which may be tested in a batch file. The error can be viewed (briefly) in the status window, or can be recorded using FFTRACE.
Login through a proxy is not currently supported. Please contact Copia support if you require this feature. All uploads are done in binary mode.
Examples:
Upload file myfile.zip to ftp.copia.com, creating a file of the same name in folder UPLOAD (note the final forward slash character), and using anonymous login with a password of an e-mail address:
FTPupload myfile.zip ftp://anonymous:tim@copia.com@ftp.copia.com/UPLOAD/
Upload file myfile.zip to ftp.copia.com, creating a file named myupload.zip in folder UPLOAD, and using a specific login (tim) and password (xyzzy):
FTPupload myfile.zip ftp://tim:xyzzy@ftp.copia.com/UPLOAD/myupload.zip
Topic url: http://www.copia.com/support/refmanual/index.html?ftpupload.htm