Zip file before uploading to Dropzone

Is there a way to generate a zip from a file that fell into dropzone and then send this zip file to the server?

I generates a zip file from using JSZipin the sendingdropzone event:

this.on("sending", function(file, xhr, formData) {

                var zip = new JSZip();
                zip.file("Hello.csv", file);

                zip.generateAsync({type:"blob"})
                .then(function(content) {
                    // see FileSaver.js
                    saveAs(content, "example.zip");
                });

            });

How to make dropzone to send this file instead of a single user?

+4
source share

Source: https://habr.com/ru/post/1657053/


All Articles