[plugin] jsZip

Post your work in progress addons and get feedback

Post » Fri Oct 31, 2014 3:31 am

JSZip

A C2 plugin that uses the JSZip library. Manage zip archives in the browser.

Updated : 2015-5-17

Features
  1. Archive
    1. Text - string
    2. Images : GIF,JPEG,PNG - dataurl
    3. PDF files - dataurl
  2. Load & merge archives dataurl, tagname, ajax
  3. Read data from archives.
  4. Modify or remove files you've archived.
  5. Invoke download of archives (blob, or dataurl)

ACES
jszip_aces.png


DOWNLOAD

Feedback is always welcome.
You do not have the required permissions to view the files attached to this post.
Last edited by Noncentz705 on Sun May 17, 2015 3:27 pm, edited 3 times in total.
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Sun Nov 09, 2014 6:02 am

Thanks for sharing!
B
159
S
27
G
17
Posts: 917
Reputation: 32,677

Post » Tue Mar 24, 2015 8:54 am

@Noncentz705
Hello!
I'm trying to zip images loaded with FileChooser this way:

Code: Select all
1. Pick file 001.jpg (53 Kb) with FileChooser
2. Create archive with tag "img"
3. Add image with dataURL 'FileChooser.FileURLAt(0)' with name "001.jpg" to archive with tag "img"
4. Invoke download archive with tag "img" with name "archive.zip" (no matter Compression is true or false)

And then I have archive.zip (1 Kb) with file 001.jpg (48 bytes) inside and of course image is bad, no data.

Image is correct and has image/jpeg MIME type.
FileChooser.FileURLAt(0) is correct too, because Sprite loads it well with Sprite - Load Image from URL action.

Where am I wrong? What is wrong? What did I forget?

P.S. And also what mean actions Clear Texture and Get Texture?

---------------------------- UPDATE

I've just understand my mistake. URL is not dataURL.
Now I make an image conversion to base64 string with "Extract sprite to base64 string" plugin by @Pode and all works good.

Another question is: any ways to make dataURL? For example without base64.
53 Kb image converts to 300 Kb image. It's very BAD!!!
B
8
S
1
Posts: 72
Reputation: 606

Post » Tue Mar 24, 2015 8:20 pm

@Noncentz705 Man, I've just received a private message from you but I can't answer because of reputation limitations..
Maybe you can write me your e-mail for better communication?
I want to know more about your brand-new version! The plugin is great in simplicity. And I'm confused that it is only one.. great luck that I found your plugin.
B
8
S
1
Posts: 72
Reputation: 606

Post » Wed Mar 25, 2015 2:55 am

I found another zip files library - zip.js
B
110
S
28
G
280
Posts: 4,488
Reputation: 156,568

Post » Thu Mar 26, 2015 8:14 am

@Noncentz705
@NickRimer

Is it possible to transfer image to blob object, instead of base64 string? So the size might not be huge.
B
110
S
28
G
280
Posts: 4,488
Reputation: 156,568

Post » Sun May 17, 2015 2:03 pm

How can i read text from a zip file?

i try this jszip.readText("texfile.txt","zipfilename\n")

@rexrainbow bro help me please
B
6
S
1
Posts: 62
Reputation: 524

Post » Sun May 17, 2015 2:46 pm

@jabedbd

Sorry, I had not used this plugin yet.
B
110
S
28
G
280
Posts: 4,488
Reputation: 156,568

Post » Sun May 17, 2015 3:14 pm

@jabedbd you might have your parameters mixed up.
The first argument is the archive tag name, the second is the path to the file.
If you still have trouble send me a minimal capx to check out showing the error.

jszip.readText("","folder/sub/foo.txt")
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Sun May 17, 2015 6:44 pm

Bro, still not work :(
Please check my capx file .....https:// dl. dropboxusercontent .com /u/52900611/capx/ test.capx
@Noncentz705
B
6
S
1
Posts: 62
Reputation: 524

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 1 guest