Uploading Output

Report Commander can upload the export file to a remote server using FTP, SFTP, or HTTP.

When you configure Report Commander to upload the output file, the output file is not saved locally. If you need to upload the file and also keep a local copy, use the Project Editor/Project Runner instead of the Command Runner. (In the Project Editor, use a File Output and an Upload Task.)

FTP or SFTP

To upload the output file using FTP or SFTP, use the following syntax for the -exportfile option:

-exportfile="protocol://userID:password@servername:port/path/filename.ext"

where

protocol
The type of server to connect to: FTP, FTPS, or SFTP.
userID
Optional user ID to use to log in to the server.
password
Optional password to use to log in to the server.
servername
The server name or address.
port
Optional port to connect to.
path
Path or directory on the server
filename.ext
The name of the file to export to/upload.

For example:

Upload to an FTP server using the specified user ID and password:

-exportfile="ftp://bob392:[email protected]/files/uploads/reports/myreport.pdf"

 

HTTP

Report Commander can upload to a Web server using either the POST or PUT method. Use the -uploadmethod command-line option to specify the method used.

HTTP PUT

When HTTP PUT is used, Report Commander "puts" the file(s) directly to the Web server. This approach works like FTP: you specify only the URL to which the output should be saved. For this method to work, the Web server must be specifically configured to accept files using HTTP PUT.

The command-line syntax for this option is:

-uploadmethod=put -exportfile=http://upload.example.com/outputfiles/myreport.pdf

-uploadmethod=put -exportfile=http://userid:[email protected]/outputfiles/myreport.pdf

HTTP POST

When HTTP POST is used, Report Commander posts the file(s) to a form on the Web server. To use this method, the necessary form must exist on the server, and must contain the necessary programming logic to accept the uploaded files and store them in the proper location.

To upload with HTTP POST, you must specify both the name of the export file and the URL of the form to which the file should be posted. The -uploadtarget option is used to specify the URL to upload to.

The command-line syntax for this option is:

-uploadmethod=post -exportfile=myreport.pdf -uploadtarget=http://upload.example.com/uploadforms/upload.aspx

-uploadmethod=post -exportfile=myreport.pdf -uploadtarget=https://userid:[email protected]/uploadforms/upload.aspx

In these examples, Report Commander exports the report to "myreport.pdf" and then posts the file to the form at upload.example.com/uploadforms/upload.aspx.