Comments (14)
Sorry to resurrect a closed issue - but I was wondering if we could get an example of fileURL usage that @sapeish implemented?
from jszip.
Actually I already implemented this functionality as a method in JSZIP called fileURL, but before creating a Push Request I gave it to a few users to test it... (no IE tests are being made anyway)
from jszip.
Here is a sample of how I used the fileURL method I implemented.
from jszip.
There is no method in JSZip to do that. If you're using a third party library with ajax support (jQuery for example), you can easily GET
the text file and put the result into a JSZip instance.
If you try to load a binary file (image, sound, zip) you may be interested in this comment.
from jszip.
@Stuk :
This is a frequent request (loading a remote zip file or adding the content of a remote file). While ajax requests are not in the scope of JSZip, loading binary files in all browsers is hard and we already have everything to do that (used in the unit tests).
Do you think we should separate that code as an extra module ? Not tied to JSZip
but to JSZipUtils
for example.
from jszip.
Yep, a separate module is appropriate. (sorry for late reply, been on holiday)
from jszip.
Really it should be a separate package (in the NPM/CommonJS sense), but sadly browser packaging isn't there yet (unless something like Mr or Browserify is used)
from jszip.
(no IE tests are being made anyway)
After every big change and before every release, I launch the unit tests in all the browsers I have and that includes IE 6 - 10. That's why the homepage says Tested with IE 6 / 7 / 8 / 9 / 10
.
from jszip.
@Stuk I'll work on this (I currently work on the documentation and I just can't write "good luck, have fun !" for this part).
I'm ok with a new module (and replace browser-test-utils.js with a dependency to it) and I can create it. Do you prefer a repository on your side (at it makes sense to have stuk/jszip and stuk/jszip-utils) or should I create it on my side ?
And if you find a better name than jszip-utils, don't hesitate :)
from jszip.
Are you planning on adding more functionality than just file downloading? Otherwise something more specific like jszip-download or jszip-remote might be better.
If you're happy having it at Stuk/... then I am too. I've created jszip-utils which we can rename (although we should do that sooner rather than later).
from jszip.
I have no roadmap for this, but adding tools to wrap FileReaders could be a good idea for example. The other popular request is "how do I get the zip file ?" so if we ever find a better answer than FileSaver.js (and encouraging everyone to drop IE <= 9), we could add it too.
I don't mind having it at Stuk/jszip-utils : I prefer the JSZip users to see a consistent ownership and the utils package near the main package rather than an utils package somewhere on github by a unknown (if they don't start digging the commit logs / issue tracker) guy.
from jszip.
I've just released the version 0.0.1 of jszip-utils so I'm closing this issue.
from jszip.
For future references, that was https://github.com/Stuk/jszip-utils
API docs at http://stuk.github.io/jszip-utils/documentation/api.html
from jszip.
Can we get an example usage?
from jszip.
Related Issues (20)
- Fortify scan finds HTML5: Overly Permissive Message Posting Policy in jszip.js line 11477 and 11504 HOT 1
- Using Jszip in Angular to export 1-2 MB files considerably slows down UI HOT 2
- linebreak issues in windows text files HOT 1
- Byte alignment of resulting zip archive
- 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
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.