ShowUsYour<Blog>

Irregular expressions regularly

Zip'ping files

Tonight I was using the ICSharpCode zip library to zip files for my Codewise implementation.  Basically, when users nominate to make a Relase visible to Codeshare, I create a manifest file and package it and the Release file into a Codewise package.

I ran the code which comes in the .chm file but, noticed that my .zip files wouldn't show any content when viewing them through the default Windows Zip File viewer.  I little bit of investigation led me to the FAQ site for the library which answered my question.  Basically, you cannot pass a fullpath to the ZipEntry class if you want it to be visible to Windows.  So, you just remove the path portion of the filename:

ZipEntry entry = new ZipEntry(Path.GetFileName(fullPath)); 

ICSharpCode Zip Library:  www.icsharpcode.net/OpenSource/SharpZipLib
FAQ Wiki: http://wiki.sharpdevelop.net/default.aspx/SharpZipLib.FrequentlyAskedQuestions
Posted: Feb 23 2005, 11:17 PM by digory | with 7 comment(s)
Filed under: , ,

Comments

TrackBack said:

# February 24, 2005 2:54 PM

Automatic Garage Door Opener said:

Now, I have to read all the fine print, and read all the ingredients to safeguard my own health. How many other consumers are in this position now that these companies have decided to trick the consumer by hiding the chemical in the products and in the

# March 24, 2008 9:00 PM

Dan said:

Thank You!

I was wondering why the hell windows couldnt read it but winzip / winrar could.. Champion

# May 14, 2008 9:16 PM

satheesh said:

can you let me know how to set zip file password ( i mean how to password protect the created zip file

# June 25, 2008 1:05 PM

public relations consultants said:

Pay Attention to Promoting Web Shows September 12, 2008 5: 56 PM With Internet video revenue still in an early phase, much of the budget for Web TV content goes directly into production. This is true particularly for producers who are creating on their

# November 11, 2008 1:45 AM

mahi manral said:

thanx for this great post.

# July 6, 2009 6:52 AM

krity said:

can you please tell me that how to make winzip / winrar folder password protected.

# July 27, 2009 5:26 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)