HTTP Upload file via HTTP function

Upload a file as multipart form data to a URL.

Help CentreBuilding Processes

This article describes the RPA HTTP functionality to upload a file via HTTP.

For a full list of available functions, please read HTTP functions.


Description

The Upload file via HTTP function uploads a file as multipart form data to a URL. You can include additional form data alongside the file upload.


Setting it up

To use the Upload file via HTTP function, follow these instructions:

{{popups:rpas/add:action=api-upload}}

Once on a process map:

  1. Navigate to the process where you would like to add the Upload file via HTTP function
  2. Click on the green button's drop-down (right side of the green button labelled "Process")
  3. On the menu that appears, click on the "+ Activity" item
  4. From here you can select the Upload file via HTTP option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
NameNoText-The alias of a previously created session (from api-session)
URLYesText-The URL to upload the file to
PathYesText-The local file path of the file to upload
Field nameNoTextfileThe form field name for the file (must match the API's expected field)
DataNoJSON-Additional form data to include with the upload as key-value pairs
HeadersNoJSON-Additional headers for this request
TimeoutNoNumber-Request timeout in seconds
VariableNoTextresponseVariable name to store the response

Output variables

VariableTypeDescription
{response}ObjectThe server response object

Errors

ErrorDescription
File not foundThe specified file does not exist at the given path
Connection failedUnable to establish a connection to the server
Upload rejectedThe server rejected the file upload

Tips

  • Use the field_name parameter to match the API's expected form field name
  • Add extra form data with the data parameter for metadata such as descriptions or tags
  • Increase timeout for large file uploads

Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.