Click here to Skip to main content
15,877,966 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

Here I came with a trouble. I have a zip file in my server. I am not suppose to download that zip file to extract its contents.

Eg., "" contains folder "test" with files "test1.jpg" & "test2.jpg".

I should not download "" folder but I should find files inside test folder placed inside that "".

If files available then I should download that jpg files and place it in my application path.

If this question is clear please help me to get out from this problem. I tried in net but I nothing to help me. Please help ASAP.

Start by looking at ZSharpLib[^] - it's pretty flexible about where the file is.

However, if the zip file is on a server, you will need direct access to the folder containing the file, and at least read permissions on that folder.
Share this answer
My preferred and simple way ( as far I know) is through DotNetZip.
Through this you not only can read but also can manipulate files like add file, delete file etc.

However, since .Net 4.5 there a is method called ZipFile.OpenRead() through which you can read files.
Something like -
string zipPath = @"c:\example\";
            using (ZipArchive archive = ZipFile.OpenRead(zipPath))
                foreach (ZipArchiveEntry entry in archive.Entries)

Hope, it helps :)

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900