You are viewing the docs for v1.3, which is not the latest release.
View latest

How to Capture the Filename When Uploading FILE-Type Inputs via API

For the complete documentation index, see llms.txt. For a full content snapshot, see llms-full.txt. Append .md to any kestra.io/docs/* URL for plain Markdown.

Capture filename on input type FILE

To upload a file for an input of type FILE, you should now use the part name for the input and the part filename attribute for the file name.

For example, when using cURL to start an execution for the following flow:

yamlid: file_flow
namespace: company.team

inputs:
  - id: fileInput
    type: FILE

tasks:
  - id: hello
    type: io.kestra.plugin.core.log.Log
    message: "{{inputs.fileInput}}"

Before 0.24 - now deprecated

bashcurl -v "http://localhost:8080/api/v1/executions/company.team/file_flow" \
    -H "Content-Type:multipart/form-data"    \
    -F "files=@/tmp/test.txt;filename=fileInput"

Since 0.24

bashcurl -v "http://localhost:8080/api/v1/executions/company.team/file_flow" \
    -H "Content-Type:multipart/form-data" \
    -F "fileInput=@/tmp/test.txt;filename=test.txt"