Save File Without Directory Structure

Nov 13, 2008 at 7:38 PM
In my ASP.NET Web App I am trying to save a .txt into a zip so I can ftp it over to google base. The problem I am having is the entire directory structure is being added to the zip file not just the .txt document.

Example of what I am getting:
-zipname.zip
--Inetpub
---wwwroot
----googlefeed
-----file.txt

I need it to be:
-zipname.zip
-file.txt

The zip saves in the correct location, I just need get rid of the directory structure. Any Ideas?

(ZipFile zip = new ZipFile(@"C:\Inetpub\wwwroot\googlefeed\zipname.zip"))
{
zip.AddFile(
@"C:\Inetpub\wwwroot\googlefeed\file.txt");
zip.Save();
}

 

 

 

Nov 13, 2008 at 9:09 PM
Found solution in docs!

zip.AddFile(@"c:Inetpub\wwwroot\googlefeed\file.txt", "");