# Binary files: Download and Upload through HTTP Request

**URL:** <https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643>\
**Category:** Questions\
**Tags:** http-request\
**Created:** [Agosto 12, 2022, 9:40pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643 "2022-08-12T21:40:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 12, 2022, 9:40pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/1 "2022-08-12T21:40:46Z")

</div>

A little background on use-case…

For those who joyously use Trello, you know that graphics attached in cards recently got a security makeover - meaning those graphics can no longer be referenced or linked to publicly. It requires any viewer to have specific member access to that content within Trello. Ugh.

We need to pull the graphic (attachment) from the card in Trello and upload it to GDrive (or other cloud storage) for public distribution, in our case by email. As a migrant from Integromat/Make, I reminisce over the ease of use with this option:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/c/f/cfd66d410cf55f3ab39d0086ac845ecfae76a3a6.png)

I need to do essentially the same thing in n8n now. Will this require a third (intermediary) step, using the [Write Binary File node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.writebinaryfile/)? Or can I simply grab the binary from the Trello request, and pass it to GDrive?

Does someone have a guide/video/tutorial for this? I’m a bit out of my element and unable to get this working. I think I’m doing several things wrong here. My end result is a PNG file with binary text inside, saved into my main G Drive directory (not the intended folder).

Here’s the workflow:

Can anyone point me in the right direction here?

Thanks!

EP

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [Agosto 15, 2022, 8:36am UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/2 "2022-08-15T08:36:01Z")

</div>

Hi @Entrepositive, downloading a binary file and then storing it on Google Drive wouldn’t require an additional node.

I suspect your Trello HTTP request might not return what you expect it to return. Check this example for downloading an image and then storing it on Google Drive:

Can you check the file coming from Trello is the file you are expecting? You can view it like so (or alternatively download it if there is no built-in viewer for it):

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/b/3/b345ba4ddf72d12445cad500443925b277e5839d.png)

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 2:38pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/3 "2022-08-15T14:38:22Z")

</div>

Hey @MutedJam

Thanks for your response. I was able to successfully run your model, with no auth, using your own image link you used. However, when I replaced the URL with my own (Trello) image link, it did not work.

I tried using my Trello auth, which has access to the graphic, but that did not work either.

In both cases, the binary summary populates correctly, and the “View” button functions but no graphic is displayed. I tend to suspect this is an authorization issue with Trello, unless it seems I’m clearly executing this incorrectly.

EP

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [Agosto 15, 2022, 2:47pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/4 "2022-08-15T14:47:17Z")

</div>

Hey @Entrepositive,

It does sound like it could be a credential issue, If you enable the full response option does it show anything else?

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 2:51pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/5 "2022-08-15T14:51:49Z")

</div>

Hi @Jon

I just tried that and got same result as before…

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 2:53pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/6 "2022-08-15T14:53:21Z")

</div>

What confuses me here is that even _with_ the Trello credentials, I have the same problem.

I would expect it either:

- worked with the right credentials or
- failed with an authorization issue without the credentials…

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [Agosto 15, 2022, 2:57pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/7 "2022-08-15T14:57:01Z")

</div>

Hey @Entrepositive,

I would have expected it to work as well, When you use the full response do you see anything in the output table like the headers?

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 3:02pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/8 "2022-08-15T15:02:32Z")

</div>

Yes I do in Table view:

```auto
**headers**
{
 [Now removed]
}

```

And here’s the Trello doc on Card Attachments. Pretty limited but I wouldn’t suspect we’d need much more from Trello…  
[https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-attachments-idattachment-get](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-attachments-idattachment-get)

I recall there was a big drama when Trello made the attachments private. Make/integromat scrambled to come up with the “Download Attachment” node for the Trello connection.

To venture a guess, perhaps that integromat function is handling more than one step… I think it handled the authorization, pulling the graphic data (I guess that’s the “binary”?) and it made it an object within the workflow.

I’m open to ideas… 😅

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 3:06pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/9 "2022-08-15T15:06:33Z")

</div>

Let me know if the headers contain sensitive info that I should remove… I’m a noob but I’m not looking to get hacked by some ahole haha

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [Agosto 15, 2022, 3:09pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/10 "2022-08-15T15:09:09Z")

</div>

Was there anything else in that response? There is a content-length which is interesting but the content-type is txt/html not an image.

Can you set the response to json? I think looking at the API docs you will need 2 nodes and this first one will return a download URL you can use.

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 4:16pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/11 "2022-08-15T16:16:54Z")

</div>

The response just passed 200 status code. Otherwise empty response…

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/5/6/56a909cfbef8ff01e96219675d3c15bf751a2fc7.png)

It appears to give same response also when I toggle the “JSON/RAW Parameters” switch ON.

Is there any way to crack this open and see what Integromat is doing here? Wondering if it’s possible to reverse engineer this..

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/3/6/3638642a4bdb52a6042f8347e49d5154bea6aaef.png)

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 4:33pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/12 "2022-08-15T16:33:07Z")

</div>

I have a feeling this is a critical piece. I’ll check back in here after a little digging:

> **[Authenticated Access to S3](https://community.developer.atlassian.com/t/authenticated-access-to-s3/40647)**
>
> tl;dr Trello will begin requiring API key and token authorization to access card attachment download URLs. Timeline As of right now, you can construct the future-proof /download/ URLs and pass in authorization. We HIGHLY recommend updating to use...

…specifically this part:

> Making a GET request with the key and token will return a 302 that redirects to the URL of the hosted file. You will always be 302’ed so long as the tokened user has access to the attachment. The route you are redirected to is only valid for 1 hour.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [Agosto 15, 2022, 4:38pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/13 "2022-08-15T16:38:52Z")

</div>

Looking at the API docs when you call `https://trello.com/1/cards/nekAAA7H/attachments/62f6c50fe4ba56837b626d57` it should return something like…

```auto
{
  "id": "5abbe4b7ddc1b351ef961414",
  "bytes": "<string>",
  "date": "2018-10-17T19:10:14.808Z",
  "edgeColor": "yellow",
  "idMember": "5abbe4b7ddc1b351ef961414",
  "isUpload": false,
  "mimeType": "",
  "name": "Deprecation Extension Notice",
  "previews": [],
  "url": "https://admin.typeform.com/form/RzExEM/share#/link",
  "pos": 1638
}

```

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 4:45pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/14 "2022-08-15T16:45:20Z")

</div>

Ah you’re right - my bad @Jon .

I am using a different URL format now, but forgot to mention earlier, from [this comment](http://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/3) onward. With the URL format you mentioned, I would get such a response. Interestingly enough, with the below URL format, I still get txt/html content-type.

I’m using this URL format:  
`https://api.trello.com/1/cards/{id}/attachments/{idAttachment}?key=APIKey&token=APIToken`  
and presumably, n8n is loading the API key and token automatically, when I set up the auth creds. Could that be a bad assumption?

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [Agosto 15, 2022, 4:54pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/15 "2022-08-15T16:54:15Z")

</div>

Hey @Entrepositive,

It will be if you don’t add the ?key= part otherwise it will add it again. So if you use `https://api.trello.com/1/cards/nekAAA7H/attachments/62f6c50fe4ba56837b626d57` what do you get back in the full response json?

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 5:08pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/16 "2022-08-15T17:08:34Z")

</div>

If I run that, I get a application/json content type in a 200 response, with different headers than discussed before. Binary dialog:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/8/b/8b39282a8f4f82f00f2dca314afba0744a0fa3e5.png)

Further, I tried following [this article](https://community.developer.atlassian.com/t/authenticated-access-to-s3/40647), with the “newer” URL format that includes “/download/” and got the below binary output. It seems I have 1 hour to access the graphic, and push it to Drive/cloud, otherwise it’s no longer accessible.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/4/4/443f97926bd9ea9a0eb7a1fecfd63af27df2895b.png)

But even so I still can’t view the graphic from the binary dialog box, as I could with your public image link from before.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [Agosto 15, 2022, 5:38pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/17 "2022-08-15T17:38:35Z")

</div>

If you download that image are you able to view it? It could just be something odd with the viewer.

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 5:55pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/18 "2022-08-15T17:55:46Z")

</div>

Good thought. It won’t open but has +200kb. It’s a corrupted img file…

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [Agosto 15, 2022, 6:01pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/19 "2022-08-15T18:01:39Z")

</div>

Sounds like I might need to set up a Trello account in the morning to test 🙂

---

<div class="post-metadata">

**Author:** ![Entrepositive](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/entrepositive/32/16077_2.png) [@Entrepositive](https://community.n8n.io/u/Entrepositive)\
**Post date:** [Agosto 15, 2022, 6:03pm UTC](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643/20 "2022-08-15T18:03:06Z")

</div>

😅 here’s a link to the public board I set up

> **[Trello](https://trello.com/invite/accept-board)**
>
> Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.

[Próxima página](https://community.n8n.io/t/binary-files-download-and-upload-through-http-request/16643.md?page=2)
