I am working on creating an Image Manipulation library using C# with MVC3. There is an option where users would be uploading multiple files. These files need to be compressed during transfer to server in order to cut down the upload time and bandwidth usage. We don't want to compromise with the quality and size of the images but do want to compress the images. Can somebody provide links to the articles which can be helpful to compress the images but maintaining their sizes and quality.
Asked
Active
Viewed 2,663 times
3
-
1if you work with bmp zipping them would be the best. Other images format are genarally already compressed – Felice Pollano Apr 26 '11 at 12:39
-
What is the goal of the compression? Strictly to save disk space on the server or also to cut down on upload time and bandwidth usage? – Brook Apr 26 '11 at 12:44
-
@Brook - the goal is to cut down the upload time and bandwidth usage. – Anil C Apr 26 '11 at 12:54
-
@Anil C: That being the case, the only way to accomplish that with C# would be to do so in silverlight, as you need to compress it within the browser before it is sent. Another option would be to use flash, a java applet, or an (ugh) activex control. You should update your question to indicate this since it changes things quite a bit. – Brook Apr 26 '11 at 12:59
-
@Brook - kindly suggest some links. – Anil C Apr 26 '11 at 13:10
-
@Anil C: I already did, see my answer below. – Brook Apr 26 '11 at 13:14
-
1So basically the question becomes 'how can I compress files before uploading them from a browser'. Good answer, Brook. – codeulike Apr 26 '11 at 13:20
1 Answers
2
Look into an existing uploader with compression. Here's a few
silverlightfileupld (Silverlight)
flexupload (Flash)

Brook
- 5,949
- 3
- 31
- 45
-
1+1, as Brook pointed out to me under my (deleted) answer, compressing files in a browser before uploading them is non-trivial because javascript cannot access the file to compress it. Hence a flash or silverlight solution is the way to go. – codeulike Apr 26 '11 at 13:23
-
Thanks for your valuable inputs but I am afraid if I could be able to use the above controls since my project is being developed in MVC 3 (Razor) & there is no way to use the Server Side Controls. Any suggestions? – Anil C Apr 26 '11 at 17:58
-
@Anil C: Both of the above controls can be used with MVC 3 and Razor, but will require sufficient knowledge of html, javascript, http, and MVC to get it working. – Brook Apr 26 '11 at 18:45
-