Thursday, March 22, 2012

Working with zip files

Hi

I have built an image gallery with photo upload, resize capabilities in (vs)VB.net. The system works like a charm but I would like to take it a stage further.
I would like my users to be able to upload a zip file containing all of their images, then once the upload is complete, I would like the server to unzip the file, read & Store the filenames in SQL DB and save them to the correct folder. Am I asking too much? If not any tips or pointers on acheiving this would be greatly appreciated.

The second option would be to allow users to upload the entire contents of a folder in one go, again not too sure where to start so any advice, tips or tutorials will be gratefully received

HalfpriceThere is currently nothing built into .NET to handle zip files. There is however a free library at the URL below:

http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx

I haven't found anything as far as uploading a whole directory. Someone else may be able to point you in the right direction on that one.
Hi,

here's an article that seems interesting:Using the Zip Classes in the J# Class Libraries to Compress Files and Data with C#.

Be aware that standard your webform only allows 4Mb upload. You can override this setting in either the machine.config or better (on a per web project basis) through the web.config.See here for more information.

Uploading multiple files can't be done unfortunately. I also wished it could be done because I also have to implement something like it in one of my next projects at work.

Grz, Kris.

0 comments:

Post a Comment