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

161
Views
No se puede abrir ningún archivo desde el navegador

estoy usando el paquete de ahorro de archivos para descargar archivos. La descarga no es el problema, parece ser la apertura de cualquier archivo. I archivo console.log de la lógica de función de archivos a continuación y obtengo esto:

 File {name: '5ece9322f34d050a92546892.jpeg', lastModified: 1641918175691, lastModifiedDate: Tue Jan 11 2022 16:22:55 GMT+0000 (Greenwich Mean Time), webkitRelativePath: '', size: 156, …} lastModified: 1641918175691 lastModifiedDate: Tue Jan 11 2022 16:22:55 GMT+0000 (Greenwich Mean Time) [[Prototype]]: Object name: "5ece9322f34d050a92546892.jpeg" size: 156 type: ".jpeg" webkitRelativePath: "" [[Prototype]]: File

Obtuve el siguiente error:

No se pudo abrir el archivo 5ece9322f34d050a92546892.jpeg. Es posible que esté dañado o use un formato de archivo que Preview no reconoce.

Mi código:

 import { saveAs } from 'file-saver'; const files = ({url, fileName}) => { const extension = url.slice(url.lastIndexOf('.')); const handleDownloadDocument = (fileUrl, name, ex) => { const file = new File([fileUrl], name, { type: ex }); return saveAs(file); }; return(<div onClick={() => handleDownloadDocument(url, fileName, extension)}> download </div>); };
about 4 years ago · Juan Pablo Isaza
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!