I'm calling an S3 Bucket requesting a .ICO file.
The content returned looks garbage (not the usual base64 encoded stream) and trying to create a file in the filecabinet causes an unexpected error.
If I navigate to the URL with the browser it correctly displays the icon.
It's working fine for other file types including PNG's, it's just failing with ICO's.
I cannot help wonder if I need to set something (maybe Accept?) in the header on the https.get request.
Any idea what I might be able to try or what would be causing the issue please?
c
creece
03/02/2023, 5:59 PM
base64 encoding is how you transfer that kind of stuff. It would just be text in the header as far as I know.
n
NElliott
03/02/2023, 6:21 PM
Sure I just wondered if, for this file type I'd need to specify something in the header of the GET for the bucket to send me what I'd expect, a base 64 encoded representation of the binary content.
b
battk
03/02/2023, 10:45 PM
N/https uses base 64 for content types that it recognizes as a binary type
battk
03/02/2023, 10:46 PM
unknown content types, which is probably what you are getting, are assumed to be utf-8, and the content is decoded as such
battk
03/02/2023, 10:46 PM
this will destroy the file contents if its not actually utf-8