Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
¿Cómo encontrar el tipo MIME de IPFS (sin extensión dada) usando Javascript?

Si tengo una dirección IPFS CID (sin extensión), de un archivo como este, por ejemplo https://ipfs.infura.io/ipfs/QmNhq4hx1KfTw1a5pTtudGXm9Q4xhWdeuWtPSSG19SSZeU , ¿cómo puedo encontrar su tipo MIME usando Javascript?

He intentado lo siguiente:

 let file='https://ipfs.infura.io/ipfs/QmNhq4hx1KfTw1a5pTtudGXm9Q4xhWdeuWtPSSG19SSZeU' if (window.FileReader && window.Blob) { console.log("All the File APIs are supported by the browser."); console.log("Type: " + file.type); } else { console.log("File and Blob are not supported by the browser"); }

Esto siempre me está dando undefined . Cualquier ayuda sería muy apreciada.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tiene una URL, por lo que para obtener el tipo mime puede realizar una solicitud HTTP HEAD.

 (async function(){ let file='https://ipfs.infura.io/ipfs/QmNhq4hx1KfTw1a5pTtudGXm9Q4xhWdeuWtPSSG19SSZeU'; var req = await fetch(file, {method:'HEAD'}); console.log(req.headers.get('content-type')); })()

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!