Zip File (addfile) problem using UNC Path Virtual Directory

Jul 15, 2010 at 5:57 PM

I'm currently using DotNetZip to zip a file in my asp.net 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/whatever.net/helloworld/hello/FILE_INPUT/APX" + DateTime.Today.ToString("yyyyMMdd") + HELLO_SEQ + ".txt";

string fileZipped = "//servername/DIR1/whatever.net/helloworld/hello/FILE_UPLOAD/FTP.zip";

// Method that performs the zip:

        public static void zipfile(string filename, string fileZipped)
        {

            using (ZipFile zip = new ZipFile())
            {

                    ZipEntry e = zip.AddFile(filename);
                    zip.Save(fileZipped);

            }
        }

Jul 31, 2010 at 8: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 10: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?

Thanks!

Mar 31, 2011 at 4: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!

Coordinator
Apr 6, 2011 at 8:55 PM

Glad you sorted it.

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