HTML Compress File Upload?

前端 未结 3 1020
长情又很酷
长情又很酷 2020-12-03 18:19

is there any way you can get a browser to compress a file before uploading it?

ie from an

Thanks, Jamie

相关标签:
3条回答
  • 2020-12-03 18:42

    Without using Flash, Java, Silverlight, or similar plug-ins, the browser doesn't compress the files it uploads. It's the server that can send compressed data, if it has been set to do so.

    To give a complete answer, I should say there are implementations of GZip made in JavaScript; considering that it is made natively in JavaScript, it is not a practical solution, and should be considered only in particular cases.

    0 讨论(0)
  • 2020-12-03 18:43

    While you can't compress the file before transfer. If the most important thing is that it resides on your server compressed, and is later downloaded compressed. You can easily set up some server side code to do the work after the file is received. As a redundant note, this will do nothing to improve upload speed, as the file is uploaded uncompressed, and then compressed server side.

    0 讨论(0)
  • 2020-12-03 18:48

    Not using pure HTTP. You could do it using silverlight or flash, though.

    0 讨论(0)
提交回复
热议问题