简体   繁体   English

客户端文件压缩

[英]Client side file compression

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. 这些文件将主要是mp4,mov和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. 另外,即使这是可能的,它是否安全以及我需要在服务器端(php)进行哪些操作以安全地解压缩它们。

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. 您只需将.mp4文件压缩即可查看,结果不会小很多。

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. compressjs是一个使用LZJB的javascript压缩库,但是我不知道是否有任何PHP函数可以做到这一点。
  • jszip uses plain old zip which is surely somehow available to PHP jszip使用纯旧的zip ,肯定可以通过PHP获得

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM