ProgerXP / FileDrop

Self-contained cross-browser pure JavaScript class for Drag & Drop and AJAX (multi) file upload.
filedropjs.org
The Unlicense
264 stars 61 forks source link

Can I compress the file before upload? #42

Open urisim opened 9 years ago

urisim commented 9 years ago

Is there a built-in support or is it something that can be done using an external library?

ProgerXP commented 9 years ago

Client-side compression is rather tricky (and probably slow). I'm not aware of any built-in method of doing this. You will have to use some 3rd party library before passing data to FileDrop - try googling for "javascript compression", "javascript gz" or similar terms, you will probably find something of use.

urisim commented 9 years ago

Thank you. Can I send a compressed buffer rather than a file using FileDrop? (Get the dropped files from FileDrop compress chunks and send each chunk to the server)

ProgerXP commented 9 years ago

Can I send a compressed buffer rather than a file using FileDrop?

You don't need FileDrop to send your buffer - you probably need it to read the chunk of file, after which you will use some 3rd party library to compress it and then send the compressed buffer via regular AJAX.

FileDrop lets you read parts of dropped file with readData: http://filedropjs.org/#partial

urisim commented 9 years ago

Ok. great. thanks