How do I attach a file to a Trello card?

This topic was automatically generated from Slack. You can find the original thread here.

Salmin Skenderovic : If I want to attach a file to a trello card - one of the params is “File” (The file to attach, as multipart/form-data)
Normally when I use Trello’s API I create new FormData() and append all my params. What is this field expected to be here?

image.png

Dylan Sather (Pipedream) : I’m looking into this. Trello does appear to allow file upload via a publicly-accessible URL. Is your file accessible via URL, or could you send it to Pipedream via our file upload API?

Salmin Skenderovic : ok I got this to work through postman:

{
    "url": "https://www.skinnytaste.com/wp-content/uploads/2011/05/Ground-Turkey-with-Potatoes-and-Spring-Peas-550x383.jpg",
    "mimeType": "image/png",
    "setCover": true
}

Salmin Skenderovic : but not with the action in pipedream:

Salmin Skenderovic : The error on the trello add attachment:

Salmin Skenderovic : Ok so it seems that I got it working by changing the params from file to url, and using the url as a string.

But I then had to switch from form-data to application/Json

Dylan Sather (Pipedream) : Thanks Salmin, yeah we’ll have to think a little more about accepting the original File parameter.

Could you do me a favor and see how the new, Add Attachment to Card via URL action looks to you? I just codified the changes you made into a new action to replace the original - this should make it more clear that you must currently pass a reference to the file via URL.