Compress files (client side) and upload
18,803
There is no built-in functionality to achieve this...
But you can do this using FileReader API and javascript zip implementation like this one http://stuk.github.io/jszip/
Author by
Hugo Jerez
Updated on July 24, 2022Comments
-
Hugo Jerez almost 2 years
What HTML5/Javascript method I can use to upload and compress files on the client side?
The code to select multiple files:
Note: If you upload files occupying this method, the server is slow to compress files, to prevent overloading is preferable to compress from the client side
<form method="post" enctype="multipart/form-data"> <input type="file" name="fileselect[]" multiple="multiple"> <input type="submit"> </form>
The code as I'd like it to be:
<script> ... </script> ... <form method="post" enctype="multipart/form-data"> <input style="display:none" type="file" name="singlezipfile"> <input type="submit"> </form>
thanks in advance