Downloading Files via Webhook Response

Sometimes, you may need the ability to download files directly through a webhook response — whether it’s for generating reports, exporting data, or automating file delivery.

This guide explains how to configure a webhook response to facilitate file downloads with the correct filename and format.

  1. Get the Binary File
    You can use any node that provides file output, such as cloud storage nodes, JavaScript nodes, etc.

  2. Set Up the Webhook Response Headers:

    • content-type: Specify the file type, e.g., application/csv for CSV files.
    • content-disposition: Use attachment; filename="yourfilename.csv" to prompt download with the specified filename.
  3. Pass the File Content in the Body of the Webhook:

    {{$19.result.file.content}}
    

Example Headers:

Now, when the webhook is triggered, the file will download automatically with the correct name and extension.

:v:

1 Like