Compress Files before save in silverlight

191 Views Asked by At

I have a file upload to upload and save bytes of files into database.

Now I want to first compress my file size before save into database.

I have gone through below site;

http://programmerpayback.com/2010/01/21/use-silverlight-to-resize-images-and-increase-compression-before-uploading/

In above site, there is solution for jpeg and png but I want to compress all files and get bytes and save into database and when I get files bytes from database it will be same as original files.

please guide me how to do this.

Thanks,

1

There are 1 best solutions below

0
John On

While for images jpeg and png are often a better way of compression, zip files offer a decent compression across all sorts of file types.

In Silverlight, you have a few options, the most popular being DotNetZip and #ziplib.

You can install both as NuGet packages.

Such libraries also have the benefit of being able to package multiple files together, something the image compression formats don't offer in any convenient way.