Reputation: 183
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
Upvotes: 10
Views: 25228
Reputation: 6312
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/
Upvotes: 12