Search code examples
c#macospermissionszipdotnetzip

DotNetZip: creating zip with C# permissions issue


I am using DotNetZip and have noticed that i am getting permission issues on Mac's. This seems to only occur when i use content disposition.

ie if i just save it to disk

using (ZipFile zip = new ZipFile(@"C:\zip\temp.zip"))
{
   // this works fine
}

but if i use content disposition like so, on mac the user permissions are denied ( everyone group is unchecked)

Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=" + filename);

using (ZipFile zip = new ZipFile(Response.OutputStream))
{
    // 
}

Solution

  • You could try changing the ApplicationType to "application/octet-stream". Believe it or not that has fixed problems for me before. It's worth a shot anyway.

    The biggest question is how is the file being requested from the Mac's side? If it's a Windows web server offering up the file, Windows can't set the permissions on the client side. If it's a web browser (Safari/Firefox) they're probably just running on the default settings. So knowing what is requesting the file from the Mac could help get the right answer.