Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compress files (client side) and upload

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

like image 811
Hugo Jerez Avatar asked Jun 15 '14 05:06

Hugo Jerez


1 Answers

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/

like image 183
Bogdan Savluk Avatar answered Oct 03 '22 02:10

Bogdan Savluk