Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Compress File Upload?

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

ie from an <input type="file">

Thanks, Jamie

like image 431
Jamie Kitson Avatar asked Dec 21 '09 12:12

Jamie Kitson


People also ask

How do I compress a file to upload?

If you're on a PC using Windows, right-click the folder and in the menu that appears you should select Send to and then under that menu select Compressed (zipped) folder.

Can we compress HTML file?

HTML compression, meanwhile, shrinks file size by replacing redundant code instances with references attached to the original information that indicate the position of this duplicated data. Called “lossless compression”, this technique ensures just that: No data loss when file sizes are reduced.


2 Answers

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.

like image 91
apaderno Avatar answered Oct 20 '22 13:10

apaderno


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

like image 21
Thomas Bonini Avatar answered Oct 20 '22 14:10

Thomas Bonini