Respond to Webhook behavior downloading a file issue
What is the error message (if any)?
hello folks,
In my workflow if i use the form trigger, my browser displays the content of the file directly into the browser, if i use the webhook trigger, my browser download the file as expected.
Webhook working as expected, form not !
What i am missing to make the form download the file instead of displaying it ?
Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
That implies to any JSON output you would like to share with us.
Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!
I’m not quite following your requirements here. If the user submits a form, why do you want to reply back with a binary file? You can use “Respond to Webhook” to send out a custom response on form submission.
Could you explain how you want that response to look like?
I don’t post the full workflow to not disclose some confidential information.
Instead of downloading the Excel file the browser show up the raw data in the page.
When i use the same worflow with a webhook as a trigger it’s working as expected.
Hey @akan , thanks for clarification. For that to work (ability for the browser to download the file), the file has to be publicly hosted somewhere. For example, that Excel document could be placed in OneDrive (and shared publickly) or FTP server. You would return the URL to it. Clicking on the URL will allow downloading the file.
Hello @ihortom, thanks for the clear answer.
Is there a way to host the file directly from n8n to avoid any third party storage ?
I would like to be functional in an internal environment without external access.
Hey @akan , I’m afraid not if you are talking about n8n Cloud (it is not a storage service). If you are self-hosting, on the other hand, then you can keep the file locally and provide a public access to it.
Hey @akan , when self-hosting, your can instruct n8n to store the binary files on the filesystem as opposed to container. It is done with help of N8N_DEFAULT_BINARY_DATA_MODE. Then it is a mater of exposing the dedicated segment of the filesystem to the internet or intranet depending the deployment purpose. This part however is not related or done by n8n. It rather a question to the DevOps department.