question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find file [Content_Types].xml in zip

See original GitHub issue

Greetings. I’ve been using your library to read xls files with no issues. However when I try to read any xlsx file, I get the following error:

Uncaught (in promise) Error: Cannot find file [Content_Types].xml in zip at getzipfile (xlsx.js:2822) at getzipstr (xlsx.js:2833) at parse_zip (xlsx.js:20373) at read_zip (xlsx.js:20707) at Object.readSync [as read] (xlsx.js:20773)

I’ve tried to use different files, even changed the extension to .zip to confirm the existence of the [Content_Types].xml. Any ideas on how to fix this issue? Here is how I’m doing to the reading:

return new Promise((resolve, reject) => {
     fileReader.onerror = () => {
          fileReader.abort();
          reject(new Error("Error"));
    };

    fileReader.onload = () => {
          resolve(fileReader.result);
    };

   fileReader.readAsBinaryString(file);      
})
.then(r => { return read(r, {type: 'binary'}); })

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
SheetJSDevcommented, Mar 18, 2020

It looks like you might be using the xlsx.min.js file directly. If you are using a script tag, can you reference xlsx.full.min.js from the dist directory?

1reaction
harshini66commented, Jun 5, 2021

resolved by integrating xlsx.full.min.js instead of xlsx.min.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find file [Content_Types].xml in zip
It seems xlsx@0.16.0 is NOT working with Angular 9 . Any help will be much appreciated. Please checkout the snip here - https://stackblitz.com/ ......
Read more >
"Cannot find file [Content_Types].xml in zip" over AWS
"Cannot find file [Content_Types].xml in zip" over AWS. ... I'm running a method that will read a excel file buffer and convert it...
Read more >
The Structure of the [Content_types].xml File - Microsoft Learn
Learn about the structure of the content types file, which contains information about the kinds of content in a VSIX package.
Read more >
SAS Zip Engine Problem - CRC32 Checksum Error
Adding custom.xml works just fine, but updating either [Content_Types].xml or _rels/.rels causes other xml files to become corrupted, typically in the xl folder ......
Read more >
纯前端使用SheetJS读取excel 报错Cannot find file ... - CSDN博客
纯前端使用SheetJS读取excel 报错Cannot find file [Content_Types].xml in zip · 问题场景 · 方案一: · 方案二:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found