问题
I need to allow users to upload large files and it can take a long time especially on mobile devices with slower connections. I'm curious to know if there are production-ready options for compressing the files on the client side prior to uploading. The files will be primarily mp4, mov, and 3gp. Also, if this is even possible, is it safe and what would I need to do on the server side (php) to safely uncompress them.
回答1:
The file formats that you are naming are already heavily compressed, compressing them more won't be a real option. You can see for yourself by just zipping a .mp4 file, the result won't be much smaller.
If you still want to try:
- compressjs is a javascript compression library using LZJB, but i don't know if there are any PHP functions that do that.
- jszip uses plain old zip which is surely somehow available to PHP
来源:https://stackoverflow.com/questions/17992207/client-side-file-compression