Using ZnEasy getPng: with an octet-stream
Next step of my Asana adventure. In a browser https://s3.amazonaws.com/profile_photos/206785263586755.0mU1QMOxVZLp3WiRWhWX... downloads a png. When I try ZnEasy getPng: with the same address, I get a walkback saying expected image/png actual application/octet-stream. Is it possible to handle this with ZnEasy, or do I have to use the ZnClient and handle the stream first? Cheers Andy
On 28 Aug 2018, at 00:41, Andy Burnett <andy.burnett@knowinnovation.com> wrote:
Next step of my Asana adventure.
In a browser
https://s3.amazonaws.com/profile_photos/206785263586755.0mU1QMOxVZLp3WiRWhWX...
downloads a png.
When I try ZnEasy getPng: with the same address, I get a walkback saying expected image/png actual application/octet-stream.
In AWS S3 you have to set the correct mime-type when you upload a file, this can also be changed afterwards. If not, it remains binary (application/octet-stream). It is possible to derive mime-types from extensions, though that is not perfect. See ZnMimeType class>>#forFilenameExtension:
Is it possible to handle this with ZnEasy,
Not as it is today.
or do I have to use the ZnClient and handle the stream first?
Yes, get the bytes and create the Form yourself.
Cheers Andy
participants (2)
-
Andy Burnett -
Sven Van Caekenberghe