Solved

upload files will stored in server and name will be stored in database.

Posted on 2010-09-16
4
543 Views
Last Modified: 2013-11-15
I have to upload files in my web page and file names will stored in database, but my files will be stored in a folder. When they download files will be download in zip format, how  will I do that ? can any expert help me.
0
Comment
Question by:Tapan Pattanaik
  • 2
4 Comments
 
LVL 4

Assisted Solution

by:antonybrahin
antonybrahin earned 100 total points
ID: 33698354
there is no libraries available in .net

u can use this. its third party and its free with source code.

http://www.icsharpcode.net/OpenSource/SharpZipLib/
0
 
LVL 21

Author Comment

by:Tapan Pattanaik
ID: 33698421
any other websites or links ?
0
 
LVL 8

Accepted Solution

by:
cubaman_24 earned 400 total points
ID: 33699782
Hello:
I found very much easier to use Ionic Zip library, also free and opensource.
http://dotnetzip.codeplex.com/

private void MyExtract()
  {
      string zipToUnpack = "C1P3SML.zip";
      string unpackDirectory = "Extracted Files";
      using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
      {
          // here, we extract every entry, but we could extract conditionally
          // based on entry name, size, date, checkbox status, etc.  
          foreach (ZipEntry e in zip1)
          {
            e.Extract(unpackDirectory, ExtractExistingFileAction.OverwriteSilently);
          }
       }
    }

private void CreateZipFile(){
     using (ZipFile zip = new ZipFile())
  {
    zip.AddFile("ReadMe.txt");
    zip.AddFile("7440-N49th.png");
    zip.AddFile("2008_Annual_Report.pdf");        
    zip.Save("Archive.zip");
  }

}

Open in new window

0
 
LVL 21

Author Closing Comment

by:Tapan Pattanaik
ID: 33767909
Thanks to all
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now