Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
Convert Raw PNG data to base64 in node js

I have an api that gives me raw png data as response, Want to convert the raw data to a file or a base64 string that can be invoked later. Below is the sample of the response that I get from the api. Can someone tell me on how this can be achieved

    �PNG


IHDR���(-sRGB���sBIT|d� IDATx���w|SU��'I��i��[(��7(�NDQ� �*����EPq�" ���""�Be�e�M�޻i����(���mҦM�����y�7�{����{���'��"A(A �����������d��h�^k����"���m"""""""���D.�X�P$tt{�������.kB�BNk'""""""r,�@�9t"""""""'��NDDDDDD�Љ�������:�`@'""""""r�DDD���f܊뮽���ha��s1~�dG7����)�8�DDD���? ���ᗭ?5��g�8�X�  ��'�ii)�hb�L�vn��.����4=/��zTV�c�>|����h�������g�8�1���Pb^{e9���p���N�GDDt1�:�YS&Omqn�k�������s�c��/���k>����V��՟���S'q㌙�w�C�޾�����,���!��v������   GЉ����T!6�'��c���   pqc��I�����������=��F��Z�F���X�~5�Z-�B#���k���޽�@QQ!�{�-\;m&�����|�i~��W�\.ǃ�b��Q����X��*�T�����s;�����
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use fs Module

let fs = require('fs')

let writer = fs.createWriteStream('xyz.png')

writer.write(<RAW data here>);

If you getting file directly in body then

let writer = fs.createWriteStream('xyz.png');

let fl = res.body.pipe(writer); (res is your response from api)

fl.on('finish', () => {...Things to do})

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda