Upload Task

An Upload Task is used to upload File Outputs (export files) to a remote server using FTP, SFTP, or HTTP.

To add a new Upload Task to a Project, click the Add Upload Task button () in the main toolbar.

Upload Task Properties Panel

To reach this panel, select the Output name in the Project Navigator and click the Settings () button in the main toolbar.

Settings

The Settings tab contains basic settings for the upload.

Upload Type

Select the kind of upload to perform:

FTP
Files are uploaded to an FTP server.
SFTP
Files are uploaded to an SFTP server.
HTTP POST
Files are uploaded to an HTTP (Web) server using the POST method.
HTTP PUT
Files are uploaded to an HTTP (Web) server using the PUT method.
Destination server

Select the server to upload files to.

Clicking the Manage file servers link takes you to the Project Properties panel, where you can manage the available File Servers.

If the server you reference is a Shared or User file server, be sure to copy the file server settings over if you plan to execute the project on a different computer or under a different user account than the one where you create it. See Sharing Settings with Another User or Computer for more information.

Target folder or path

Enter the path or folder to upload files to.

  • For an FTP or SFTP server, this is the folder to use, relative to the "home" directory that the server assigns you when you log in. If you begin the folder name with "/", it becomes an absolute path (relative to the root of the file structure exposed by the server).
  • For an HTTP POST or HTTP PUT upload, this is the path and name of the Web page to POST/PUT to. For example, if you want to upload to the URL "http://www.example.com/filetransfer/upload.aspx", the File Server will be configured as http://www.example.com, and you will set the target path to /filetransfer/upload.aspx.

    To include the name of the file being uploaded as part of the path or query string, use the "${FileName}" variable. For example, when using the PUT method you could use a path like /filetransfer/upload/${FileName}.

The file name used for the file is the file name specified in the File Output settings (without the path information).

This field can contain variables and functions that are replaced at runtime. More... ClosedClick the {} button to display the text editor, which helps you insert variables and functions into the text. When you hover your mouse pointer over the field for a second, a preview of the "expanded" text will be displayed so you can confirm your variables and functions are working correctly.

Variables and functions are re-evaluated for each file that Report Commander uploads, so it is possible to upload each report output to a different folder on the same server.

HTTP Options
Report an error if the server response does not include this text

If the Web server returns an error code (such as a 404 Not Found error, or 500 Server error), the task will log an error message. However, there may be cases where the file is not uploaded, but the server still returns a success result. For example, if the Web server redirects the upload attempt to a login page, it may still return a 200 Success message, so Report Commander will not know there was a problem.

To solve this problem, your upload page can be coded to return a certain message in the response to indicate that the file was successfully transferred. You can then configure Report Commander to check for this message in the Response.

For example, your upload handler is programmed to return the message "File accepted" when the file is successfully transferred. In Report Commander, check the Report an error if the server response does not include this text option and enter File accepted as the text to look for. If the response from the Web server does not include "File accepted," Report Commander will log an error message.

When you specify text to look for, Report Commander looks for the text anywhere in the response returned by the server, and ignores the case of the text.

For more control over matching you can check the Use Regular Expressions option and specify a regular expression as the text to match. Report Commander uses the Microsoft .NET syntax for regular expression matching, with case-insensitive matching. Refer to the Microsoft documentation for more information.

ID Code
The ID Code is used to identify this item when filtering is applied on the Project Runner command line.

Files

On the Files page you specify the report outputs and other files you want to upload.

Include the output files from these exports

This list shows all file outputs (export files) produced by this project. Check the box next to each file you want to include as an attachment to the message.

If you already used an output as the body of the message, you don't need to select it here, too. If you do, it will be the body of the message and will also be included as an attachment.

Also attach these files

Use this option to attach additional files to the message. For example, you might have a PDF file with instructions for interpreting the report.

When you click Add or Edit, the File to Attach window opens to allow you to specify the file name.