Sorry I have been searching for hours and hours now been looking for a way to gzip a file in javascript client side so i can then upload it and unzip it server side. You may ask why not just zip it normally? This is for my users and most of them think a mouse is a furry creature :)

Recommended Answers

All 5 Replies

Member Avatar for stbuchok

You can't, at least I've never seen this done. I've also looked into this a few years ago. However, now that there is the ability to read files before they go to the server using JavaScript, there might be a way. I have no idea how though.

If you are getting time outs, you could upload the file in chunks.

http://www.html5rocks.com/en/tutorials/file/dndfiles/

Hopefully this helps.

Javascript selection bunch of fiels and creating zip in harddisk, then uploading to server, It looks securit issue. It will depend on users permissions in brwoser.

Don not tamper system for users. Educate them. Majority users are foolish, we can not drive as they say always.

I doubt this is possible in JavaScript alone. You probably want to look into using Flash or Java to try to accomplish this.

If you are compressing the file only for transfer and then immediately uncompressing it once it's on your server, is it really worth it? What type of files do you plan to be compressing? If it's a binary file, there's a good chance whatever program created the file has already compressed it to some degree meaning you won't see much of a benefit from compressing it again yourself.

problem with using flash or java again is that not everyone has it installed, only today I installed java on my computer I have had it for over 3 months without ever needing to use it.It has to be in a language that all computers already have installed. I believe flash is the same it needs in stalling right?. I am trying to get the file into a string then I will try to zip it??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.