I'm receiving a byte
stream data as a response from the server. I need to save it as an image file with the extension we want.
I've tried creating a blob
out of the byte
stream but it seems to break/corrupt the image.
When I use the same request in cUrl
using command prompt in Windows, and redirect the whole response to a file, the image seems to be written and not be corrupted.
Can you suggest a way where I can directly write the byte data to a new file without using any intermediate blob variables.
The response data from service is like below,
�����JFIF���
�����C�
���C���h�"��������������
�������}�!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�����������������������������������������������������������������������������������
������w�!1AQaq"2�B���� #3R�br�
$4�
Thanks in advance!!!!