This project is read-only.

How to avoid complete folders?

Aug 8, 2012 at 11:54 PM
Edited Aug 8, 2012 at 11:54 PM

Hello -

In my application I am creating pdf files in a folder and I am trying to zip the folder using DotNetZip. Following is the code I am using to add the pdf files in the zip.


zip.AddFile(HttpContext.Current.Server.MapPath("~\\Letters\\" + objEmployee.emp_id.ToString() + ".pdf"));   


I am able to download the zip file, but my problem is that my zip file contains entire folder structure (inetpub\wwwroot\empcomp\letters) instead of just having just the Letters folder.

Is there any way to remove all the empty folders inetpub, wwwroot, empcomp etc?




Sep 6, 2012 at 4:01 PM

I did the following:

archivoZip.AddFiles(rutaArchivos, false, "Archivos");

This is working for me. I get only the files in the folders.

I hope this help you.