how to remove directory structure from zip file

Jul 2, 2012 at 9:37 PM
Edited Jul 2, 2012 at 9:44 PM

Hello,

I create a csv file say c:\tmp\myfolder\mydata.csv

when I use zipfile to zip to mydata.zip, it works fine.

when I double click the zip file, I see the first leve is c:\, then next level is tmp, then myfolder, then the file mydata.csv.

What I want in zip is just mydata.csv, so when I double click mydata.zip,  I will see the file mydata.csv only, i.e. without directory info.   How to accomplish this?

 

I found it, thanks

http://dotnetzip.codeplex.com/workitem/11987

Thanks

Jul 10, 2012 at 10:40 AM

you need to write code like mentioned below 

createZipFile.AddFile(fileLocation, string.Empty);

adding string.empty will remove the directory structure 

refer links for more info 

http://csharpdotnetfreak.blogspot.com/2012/06/create-zip-files-in-aspnet-c-vb.html

http://csharpdotnetfreak.blogspot.com/2012/07/download-multiple-files-as-zip-aspnet.html

http://csharpdotnetfreak.blogspot.com/2012/07/upload-unzip-extract-zip-files-aspnet.html

May 3, 2013 at 6:49 PM
Edited May 3, 2013 at 6:54 PM
Any support for discarding the directory structure of a zip file not created by DotNetZip, like the behavior of InfoZip's unzip -j flag?

Answered earlier, thank you:
https://dotnetzip.codeplex.com/discussions/83773