HTTP Action Files

Overview


When a File slot is resolved in a plugin, the file is not sent in the HTTP request body. Instead, it is passed as a dedicated file argument using multipart/form-data encoding. This is handled automatically by the HTTP Action editor via the File tab.

The File tab constructs a file dictionary where:

  • Keys = field name expected by the target API
  • Values = the File object

Only one file is ever included, even if multiple were selected in the UI.


File Object Structure

{
  "file_name": string, // Original filename (e.g., "report.pdf")
  "location": string,  // Internal file ID
  "content": string   // Base64-encoded content
}

This object is referenced in the File tab as file.


Mapping in the File Tab

Use the File tab to map the incoming file to the API's expected field name.

In the File tab, define:

<API field name>: file

Example: API expects field attachment

API Field NameMapped Value
attachmentfile

Generated Request (cURL equivalent):

curl -X POST https://api.example.com/upload \
  -F "attachment=@original_filename.pdf"

The HTTP Action editor constructs this automatically from the File tab mapping.


Filename Handling

Callout: The uploaded filename is fixed to file.file_name at upload time.
You cannot change it via the File tab.

Options to Control Filename

OptionHow
User renames before uploadInstruct user: "Rename file to Q3_Report.pdf before uploading"
API accepts filename parameterSend in JSON body:

Let API handle filename

Send filename separately in JSON body:

{
  "filename": "{{file.file_name}}",
  "category": "invoice"
}

cURL Equivalent (Generated Internally)

For an HTTP action with:

  • URL: POST https://upload.example.com/submit
  • Body: { "user": "john" }
  • File mapping: docfile
curl -X POST https://upload.example.com/submit \
  -H "Content-Type: multipart/form-data" \
  -F "[email protected]" \
  -F "{"user": "john"}"

Best Practices

  1. Always use File tab — never embed in JSON.
  2. Rename early if needed.
  3. Use TEST button — check your service for the uploaded file.