javascript - What is best way to compress file and text "inside browser" before sending to server? - Stack Ove

admin2025-04-20  0

Actually I trying to upload large text and pdf files. I want to press file chunks in browser only. So i can encrypt and send these lite chunk through ajax smoothly without hanging browser. I am seeking help related to file chunk pression. And at server side easily can depress using java library. Can anyone suggest me best way to do it ? It should be in client side and inside browser(IE11,Google Chrome).

Actually I trying to upload large text and pdf files. I want to press file chunks in browser only. So i can encrypt and send these lite chunk through ajax smoothly without hanging browser. I am seeking help related to file chunk pression. And at server side easily can depress using java library. Can anyone suggest me best way to do it ? It should be in client side and inside browser(IE11,Google Chrome).

Share Improve this question edited Mar 16, 2016 at 19:11 Jeet asked Mar 16, 2016 at 17:34 JeetJeet 1831 gold badge2 silver badges10 bronze badges 11
  • 2 why is here java tag? – Andrew Commented Mar 16, 2016 at 17:35
  • I think Amazon sends all its images as zip files, to save space and increase upload times, as is evident, but I'm not sure about the exact pression type - might be bzip or gzip. – Arif Burhan Commented Mar 16, 2016 at 17:37
  • If anyway we can call java utility inside javascript so. – Jeet Commented Mar 16, 2016 at 17:37
  • danml./js/pression.js has deflate() and inflate() which works pretty well – dandavis Commented Mar 16, 2016 at 17:42
  • @ArifBurhan okay but if you have some idea can you tell me which library i can you use my case. – Jeet Commented Mar 16, 2016 at 17:43
 |  Show 6 more ments

2 Answers 2

Reset to default 5

Gzip is a popular method for pressing data before sending it over the web.

There are many javascript libraries, such as https://github./beatgammit/gzip-js which will press a string/byte array for you.

Java has Gzip functionality built-in through java.util.zip.GZIPInputStream;; a simple google search will make it easy to learn how to use it.

There are several JS libs that can help you with that, if the zip format is acceptable. JSZip is one of the most well known ones.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745125522a286402.html

最新回复(0)