I’m trying to upload an attachment file from a gmail message to a REST API that accepts the file in a ‘document’ form field that should contain the ‘file’. I’m not clear on the format of what this file should be. I’m trying to use a convert node to get the file contents and embed them in the http request but failing with the contents not being recognized correctly.
What is the error message (if any)?
ERROR: Bad request - please check your parameters
400 - “{"document":["The submitted data was not a file. Check the encoding type on the form."]}”
Please share your workflow
Share the output returned by the last node
ERROR: Bad request - please check your parameters
400 - “{"document":["The submitted data was not a file. Check the encoding type on the form."]}”
To send a file using the HTTP Request node using the multipart/form-data content type you wouldn’t have to convert it to JSON like you do in your example workflow. Instead, you can send your binary object straight away by selecting n8n Binary Data as the parameter, then providing the name of your binary field (probably attachment_0 in your case).