Compress the file on the client side

I want to upload a file to the server, but is there any way (using javascript) to compress the image on the client side before uploading?

+3
source share
8 answers

Big update: in html5 you have access to the previously selected file (-list) with javascript! Details: http://www.html5rocks.com/en/tutorials/file/dndfiles/

+1
source

In IE, you can create ActiveX controls that theoretically allow you to do whatever you like on the client side. However (and its BIG), most likely, it will ring disturbing calls to users / browsers from a security point of view.

ActiveX JavaScript:

var myObject = new ActiveXObject('MyObject.MyControl');
0

, javascript: javascript. , java-, flash ( asp.net) Silverlight.

codeplex: http://www.codeplex.com/SilverlightFileUpld

0

zip- , : . SO. JavaScript.

0

, , , .

, .

0

JavaScript: http://www.bytestrom.eu/blog/2009/1120a_jpeg_encoder_for_javascript

, . , Flash Java.

Flash JPEG AFAIK. . , SWFUpload (http://swfupload.org/), , , . (, JPEG), , SWFUpload .

Edit: , SWFUpload Alpha. : http://demo.swfupload.org/v250alpha1/resizedemo/index.php

, , .

JavaScript, , , , :

swfu.startResizedUpload(swfu.getQueueFile(0).id, 100, 100, SWFUpload.RESIZE_ENCODING.JPEG, 100);

!

0

, JavaScript , .

- Flash Java-, , , .

-1

Since you do not have access to the data of the downloaded files, this does not make much sense. You can use FlashPlayer 10, which has limited access to the file system and offers data compression (even at the appropriate speed).

-1
source

Source: https://habr.com/ru/post/1724943/


All Articles