Zip File (addfile) problem using UNC Path Virtual Directory

Jul 15, 2010 at 4:57 PM

I'm currently using DotNetZip to zip a file in my application.  When I use localhost using my local C: Drive works perfect, but when I use an UNC virtual directory, it doesn't work.  Any feedback is greatly appreciated.

Here's my code:

// Variables...

string filename =   "//servername/DIR1/" + DateTime.Today.ToString("yyyyMMdd") + HELLO_SEQ + ".txt";

string fileZipped = "//servername/DIR1/";

// Method that performs the zip:

        public static void zipfile(string filename, string fileZipped)

            using (ZipFile zip = new ZipFile())

                    ZipEntry e = zip.AddFile(filename);


Jul 31, 2010 at 7:49 AM
hi, The simplest way is to map a network drive and avoid UNC. Alternatively you could either use Server.MapPath() function which returns the absolute path of your file.
Mar 30, 2011 at 9:11 PM

This appears to still be an issue (bug).  I have an application that runs through hundreds of various UNC paths on various servers, all with permissions tightly locked down.  I cannot simply remap from something like \\server\share to \\server\c$\share. 

Is there a chance this will be fixed?

Server.MapPath() appears to be an II6 feature???  Is there something more suited for a Windows XP machine running .net 4 w/ no IIS?


Mar 31, 2011 at 3:12 AM

Whoops, the error is entirely on my end!  So, I'm able to zip files with UNC paths with no problem. 

BTW, I'm migrating from Chilkat, and find your stuff much cleaner to use.  Kudos!

Apr 6, 2011 at 7:55 PM

Glad you sorted it.

Thanks for the compliments, and good luck with your project.