How to read contents of attachments acquired from HTTP request?

Hi.

I have one project needs to connect to an external server (via HTTP request) and get a binary data file.
So far, so good and HTTP response shows something like:

headers: object
  date: "Tue, 22 Oct 2024 04:19:28 GMT"
  server: "Apache"
  x-frame-options: "DENY"
  x-content-type-options: "nosniff"
  x-xss-protection: "1; mode=block"
  content-type: "multipart/mixed;boundary="BOUNDARY""
  content-length: "222"
  strict-transport-security: "max-age=31536000; includeSubDomains"
  connection: "close"
  x-node-red-request-node: "0206729a"
payload: buffer[222]
  --BOUNDARY
  Content-Length: 33
  Content-Type: application/octet-stream
  Content-Disposition: attachment; 
  filename=20241022.data
  --BOUNDARY--
statusCode: 200
responseUrl: "https://response/url/"
redirectList: array[0]
retry: 0

Now, I need to see the contents of the attached file (i.e. 20241022.data) to process the flow further, but I have no idea where this attachment is stored, or even if I need to "save" the file somehow.
I just need to see the contents of the file (its a binary file).

Somebody help me figure this out?

Is it not the buffer in msg.payload?

Oh, you are my hero, man!
I thought string conversion version of payload tells everything, but actually I needed to to look into raw response.
the payload (in string) actually showed like below:-

--BOUNDARY
Content-Length: 33
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=20241022.data


--BOUNDARY--

with those empty spaces and looking into raw data showed me the data I wanted.

Really appreciate your comment.
Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.