dotnetzip

DotNetZip: creating zip with C# permissions issue

I am using DotNetZip and have noticed that i am getting permission issues on Mac's. This seems to only occur when i use content disposition. ie if i just save it to disk using (ZipFile zip = new ZipFile(@"C:\zip\temp.zip")) { // this works fine } but if i use content disposition like so, on mac the user permissions are denied ( e...

Sending Zip file to Client via Response with DotNetZip

this is my code private void sendToClient(Dictionary<string, string> reportDic) { Response.Clear(); Response.BufferOutput = false; String ReadmeText = "some text"; Response.ContentType = "application/zip"; Response.AddHeader("content-disposition", "filename=" + "filename.zip"); usi...

Create Zip file from stream and download it

I have a DataTable that i want to convert it to xml and then zip it, using DotNetZip. finally user can download it via Asp.Net webpage. My code in below dt.TableName = "Declaration"; MemoryStream stream = new MemoryStream(); dt.WriteXml(stream); ZipFile zipFile = new ZipFile(); zipFile.AddEntry("Report.xml", "", s...

Extract a ZIP file programmatically by DotNetZip library?

I have a function that get a ZIP file and extract it to a directory (I use DotNetZip library.) public void ExtractFileToDirectory(string zipFileName, string outputDirectory) { ZipFile zip = ZipFile.Read(zipFileName); Directory.CreateDirectory(outputDirectory); zip.ExtractAll(outputDirectory,ExtractExistingFileAction.Overw...

DotNetZip: How to extract files, but ignoring the path in the zipfile?

Trying to extract files to a given folder ignoring the path in the zipfile but there doesn't seem to be a way. This seems a fairly basic requirement given all the other good stuff implemented in there. What am i missing ? code is - using (Ionic.Zip.ZipFile zf = Ionic.Zip.ZipFile.Read(zipPath)) { zf.ExtractAll(appPath); } ...

DotNetZip trouble with coding

I am using DotNetZip. When i am archiving file which have english name all normally. but when i archiving file with russian names in result archive with bad names of file. Some peoplese said that string ZipConstants.DefaultCodePage = 866; But it not compile. I also use zip.UseUnicodeAsNecessary properties, and convert my file names to...

DotNetZip trouble with russian encoding

i use DotNetZip in my project. using (var zip = new ZipFile()) { zip.ProvisionalAlternateEncoding = System.Text.Encoding.GetEncoding(866); zip.AddFile(filename, "directory\\in\\archive"); zip.Save("archive.zip"); } all ok but when i use method AddDirectoryByName i have a bad directory names. ...

What is the root directory OR how do I set the directory in DotNetZip

where does DotNetZip get it's root directory for saving. All the save examples don't show the directory. My goal is to recurse a folder and subfolders. In each folder I want to zip all the files into one zip and delete the source files. private void CopyFolder(string srcPath, string dstPath) { if (!Directory.Exists(ds...

unzip password protected file

how to unzip a password protected file using dotnetzip or sharpziplib (if the password is not known). ...

listing files using dotnetzip

using (ZipFile zip = ZipFile.Read(ExistingZipFile)) { foreach (ZipEntry e in zip) { if (header) { System.Console.WriteLine("Zipfile: {0}", zip.Name); if ((zip.Comment != null) && (zip.Comment != "")) System.Console.WriteLine("Comment: {0}", zip.Comment); System.Co...

decompress deflate64

I've got a compressed string of bytes coming out of a database which I need to decompress so as to retrieve the rtf file in there. This is the requirement. I tried to use DotNetZip and it has given me a 50% success ratio. The failed 50% gave me a unsupported encryption (0x09, deflate64) error. So I think my problem is that some of the c...

List All Files in a Directory using Dot Net Zip?

Is there anyway in Dot Net Zip that I can use to list all the names of files in a specific directory? For example, i can specify Directory1 and get File3 and File4 etc ZipFile ------- File1 File2 Directory1 File3 File4 Directory2 File5 File6 ZipFile object has only Entries, Entries Sorted, and Entries File Names.....

Create Zip files in Classic ASP using DotNetZip or SharpZipLib

Hello Everyone. In ASP.Net two of the possible ways to make the zip files are Sharp Zip Library Dot Net Zip Library How can i use any of these in Classic ASP to make the zip files ? And which one will be better ? ...

DotNetZip Operating System Hooks

I would like to be able to read / write files to a WinZip file, WinRAR file, Compressed folder, etc. without Windows knowing the difference. Basically want these to be treated as folders where anything running in Windows would have transparent access. Is there a way to do this using DotNetZip and hooking into the operating system? Also ...

Using a MemoryStream with FileStreamResult possible?

I'm using DotNetZip to create a zip file and pass it to a FileResult. On debug, I can verify that the MemoryStream contains a file, but when I run it through FileStreamResult, it returns 0bytes: public FileResult GetZipFiles(int documentId) { var file = fileRepository.Get(documentId); var zip = new ZipFile(); var st...

Dotnetzip, Event Handler not Fired after Save

Hi, I have a small problem, which might me a stupid mistake on my side. Here is my code to create a zipfile when needed and the method to add a file to the archive. Adding a file works without problem but for some reason the Event is not fired after saving. I set a breakpoint at zipFile_SaveProgress, the event is not fired. class C...

Remove DLL dependency for an Application

Hey! In my application, I need to Zip and Unzip some files. For that I have used DotNet Zip Library (Ionic.Zip.dll-- DotNet Zip Lib ) Everything works fine but when I take EXE of my file and try to run it from different folder, it fails to run. I have to keep Ionic.Zip.dll in the folder where my application resides. Is there any way o...

How to stop asp.net to send a faulty response

I'm working on a functionality in my asp.net web site that enables the user to download some files as a zip file. I'm using the DotNetZip library to generate the zip file. My code looks like this: protected void OkbtnZipExport_OnClickEvent(object sender, EventArgs e) { var selectedDocumentIds = GetSelectedDocIds(); s...