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

169
Vistas
How do I convert my IPFS return into the original .midi or .png file using js (ipfs-http-client)?

I have images and audio files stored in IPFS. When I retrieve the contents in javascript I end up with a Buffer or a tarballed header/body output. How do I convert this back into the original file to use on the website?

const audioCID = CID.parse("QmapPj7koCCMp241CAhwZV413K3FrqVnYdKC2GeTQHsCuF")
const output = await pipe(
    ipfs.get(audioCID),
    // tarballed,
    collect
)   

The output I get is:

output [
  <Buffer 51 6d 61 70 50 6a 37 6b 6f 43 43 4d 70 32 34 31 43 41 68 77 5a 56 34 31 33 4b 33 46 72 71 56 6e 59 64 4b 43 32 47 65 54 51 48 73 43 75 46 00 00 00 00 ... 1998 more bytes>
]
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The output (converting to ASCII) is the CID:

51 6d 61 70 50 6a 37 6b 6f 43 43 4d 70 32 34 31 43 41 68 77 5a 56 34 31 33 4b 33 46 72 71 56 6e 59 64 4b 43 32 47 65 54 51 48 73 43 75 46 00 00 00 00

=

QmapPj7koCCMp241CAhwZV413K3FrqVnYdKC2GeTQHsCuF

Source: https://www.rapidtables.com/convert/number/ascii-hex-bin-dec-converter.html

Solution:

You need to get the content of the IPFS file with ipfs.cat: https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/FILES.md#ipfscatipfspath-options

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