Using HTTP Request for file downloads

I'm downloading files from a DAM system for distributing via FTP. My problem is with HTTP Request and file-out. I use these together and the resulting file is always unusable. I've tried with JPG and EPUB (a ZIP) and they can't be opened after download. The request works i.e. I get a payload with the file in it; and the write-file works i.e. I get a file saved on disk. I've tried a variety of return types in HTTP Req and encodings in write-file with no luck. The source file types will vary so I'm looking for a method which will work with any type. Here are the 2 nodes:

[
{
"id": "348bff8a3bb6c980",
"type": "http request",
"z": "b97ef552ede161d0",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "Authorization",
"keyValue": "",
"valueType": "msg",
"valueValue": "token"
}
],
"x": 690,
"y": 620,
"wires": [
[
"ef80dbd968629194",
"fdf09f34a3eb11cf"
]
]
},
{
"id": "fdf09f34a3eb11cf",
"type": "file",
"z": "b97ef552ede161d0",
"name": "Save Asset Download",
"filename": "pathdl",
"filenameType": "msg",
"appendNewline": false,
"createDir": false,
"overwriteFile": "true",
"encoding": "utf8",
"x": 940,
"y": 620,
"wires": [
[
"f69d1d39b2629628"
]
]
}
]

Have you verified what comes back from the http node with a debug? Show us a screenshot. Do it with parsed and string mode. The file data may be a sub property of the payload.

Ps, please use a code block when posting code/flow JSON.


In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json