Comments (4)
When you generate the zip file, you don't have (yet) the image loaded. Try generating the blobLink.href
in the ajax callback, after adding the image file :-)
You also found a bug in JSZip : without any content, the generated file is invalid...
from jszip.
After some tests, I found out that the empty JSZip zip file and an empty zip file generated with zip
are exactly the same :
$ hexdump test.zip
0000000 4b50 0605 0000 0000 0000 0000 0000 0000
0000010 0000 0000 0000
0000016
(zip
doesn't want to create an empty zip file so I used the zip test.zip deleteme.txt ; zip -d test.zip deleteme.txt
trick and I got a nice zip warning: zip file empty
)
file
doesn't recognize the file type but unzip
print a warning : warning [test.zip]: zipfile is empty
.
I think the result isn't a bug, just a strange usecase. Maybe we should log a warning when generating an empty zip file ?
from jszip.
You'd better leave it as is, otherwise you'd eventually have to face some fellow who needs empty zip files for some reason and thus needs an option to disable that warning.
from jszip.
Well I feel dumb. Obviously it needs to be in the callback.
Thanks for the quick response.
from jszip.
Related Issues (20)
- Missing folders when trying to extract files which are compressed using native compression software of Windows HOT 1
- Unable to open docx file in Node
- Same zip different zipContents when loadAsync
- JSZip v3.10+ breaks in some sandboxed browser environment because dependency setimmediate breaks HOT 1
- Can we generate LF instead of CRLF
- Reading Folder Doesn't Work
- Large zip file breaks with loadAsync
- Math.random() usage
- Is jszip unmaintained? HOT 9
- Zipping 1GB+ and splitting to chunks is slow - is there a way to speed it up?
- Can't use ReadableStream from generateNodeStream in the PutObjectCommand of s3
- escape and unescape are deprecated
- Error: End of data reached
- Failed to resolve module specifier.
- ZIP64 Support broken HOT 2
- Add asyncIterator support to NodejsStreamOutputAdapter
- Is there a recommended tool library for parsing rar format compression packages ?
- Can't unzip some zip files HOT 1
- (MIT OR GPL-3.0-or-later) HOT 1
- How to pass the loadAsync method into arraybuffer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jszip.