Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-16
4
Medium Priority
?
552 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 400 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 1600 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

886 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