[
  {
    "Id": "140291",
    "ThreadId": "42230",
    "Html": "I'm using the dotnetzip in conjunction with a file uploader control in an aspx page and it works great. The only problem I have run into is that when an .mp3 is zipped ( client insists that this happens ) then the zip file cannot be downloaded via a web page or ftp and it cannot be deleted via ftp. It works fine on my developement computer. The live site is on a Window 2008 server. If I go to the server I can delete it there and when I check permissions, it doesn't have permissions for the website user/ftp name like all the other files have. Can you suggest a solution?<br>\r\nI have tried it with <span style=\"font-size:13px\">file.ForceNoCompression = </span><span style=\"font-size:13px;color:#0000ff\">true</span><span style=\"font-size:13px\">; and <span style=\"font-size:13px\">file.ForceNoCompression = false:<br>\r\nThanks<br>\r\n</span><span style=\"font-size:13px\"><br>\r\n</span></span>\r\n",
    "PostedDate": "2008-12-13T12:47:15.763-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "140313",
    "ThreadId": "42230",
    "Html": "Is the DotNetZip library really central to the problem?  Sounds to me like the ASPX page creates a file, and that file has permissions that don't work very well for other purposes. <br>\r\nDoes it really matter if the file is created via the DotNetZip library?  What if you just created the file manually with System.IO.File.Open or Create calls?   Are the permissions set properly then? <br>\r\n<br>\r\nIf I understand your problem correctly, then it really should not matter whether there is compression or not. <br>\r\n<br>\r\nanyway it sounds like you need to experiment further.\r\n",
    "PostedDate": "2008-12-13T14:56:00.387-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "140423",
    "ThreadId": "42230",
    "Html": "The Dotnetzip was the last customization I added to the code. The files are uploaded by the customer from a webpage using the AjaxUploader.com uploader. I got that all working and then the client wanted all the files except jpg and pdf zipped as they were uploaded. AjaxUploader recommended DotNetZip. I just checked again and realized that .mp3 files were the only ones I had tried using compression. I just uploaded a .zip file and used compression and it has the same problem. So it wasn't just mp3 files. I must be doing something wrong with permissions or neglecting to do something. If the files are uploaded as they are, then they can be downloaded . Here is part of the code I am using-- can you see that I am using the zip in an incorrect way? I'm at a loss as to what to check since I'm not familiar with filestreams. <br>\r\n<span style=\"font-size:13px\">\r\n<p>&nbsp;</p>\r\n</span>\r\n<p><span style=\"font-size:13px;color:#0000ff\">void</span><span style=\"font-size:13px\"> Uploader_FileUploaded(</span><span style=\"font-size:13px;color:#0000ff\">object</span><span style=\"font-size:13px\"> sender, </span><span style=\"font-size:13px;color:#2b91af\">UploaderEventArgs</span><span style=\"font-size:13px\"> args)\r\n<p>&nbsp;</p>\r\n<p>{</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#2b91af\">Uploader</span><span style=\"font-size:13px\"> uploader = (</span><span style=\"font-size:13px;color:#2b91af\">Uploader</span><span style=\"font-size:13px\">)sender;\r\n<p>&nbsp;</p>\r\n<p>uploader.SetAdvancedOption(</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#2b91af\">UploaderAdvancedOption</span><span style=\"font-size:13px\">.NoFlash10, </span><span style=\"font-size:13px;color:#a31515\">&quot;true&quot;</span><span style=\"font-size:13px\">);\r\n<p>&nbsp;</p>\r\n<p>InsertMsg(</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#a31515\">&quot;File uploaded! &quot;</span><span style=\"font-size:13px\"> + args.FileName + </span><span style=\"font-size:13px;color:#a31515\">&quot;, &quot;</span><span style=\"font-size:13px\"> + args.FileSize + </span><span style=\"font-size:13px;color:#a31515\">&quot; bytes.&quot;</span><span style=\"font-size:13px\">);\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">string</span><span style=\"font-size:13px\"> selectedItem = DropDownListTemplateFields.SelectedItem.Text.ToString();\r\n<p>&nbsp;</p>\r\n<p>selectedItem = </p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#2b91af\">StringHelper</span><span style=\"font-size:13px\">.Replace(selectedItem, </span><span style=\"font-size:13px;color:#a31515\">&quot; &quot;</span><span style=\"font-size:13px\">, </span><span style=\"font-size:13px;color:#a31515\">&quot;&quot;</span><span style=\"font-size:13px\">);\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">string</span><span style=\"font-size:13px\"> folder = Server.MapPath(</span><span style=\"font-size:13px;color:#a31515\">&quot;~/Assets/OrderUploads&quot;</span><span style=\"font-size:13px\">);\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">string</span><span style=\"font-size:13px\"> thisOrderId = OrderId.ToString();\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">string</span><span style=\"font-size:13px\"> pathURL = </span><span style=\"font-size:13px;color:#a31515\">&quot;../Assets/OrderUploads/&quot;</span><span style=\"font-size:13px\">;\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">string</span><span style=\"font-size:13px\"> fileName = thisOrderId + </span><span style=\"font-size:13px;color:#a31515\">&quot;-&quot;</span><span style=\"font-size:13px\"> + </span><span style=\"font-size:13px;color:#2b91af\">DateTime</span><span style=\"font-size:13px\">.Now.ToString(</span><span style=\"font-size:13px;color:#a31515\">&quot;yyyyMMddHmm&quot;</span><span style=\"font-size:13px\">) + </span><span style=\"font-size:13px;color:#a31515\">&quot;-&quot;</span><span style=\"font-size:13px\"> + selectedItem + </span><span style=\"font-size:13px;color:#a31515\">&quot;-&quot;</span><span style=\"font-size:13px\"> + args.FileName;\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">string</span><span style=\"font-size:13px\"> zipFileName = </span><span style=\"font-size:13px;color:#a31515\">&quot;&quot;</span><span style=\"font-size:13px\">;\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">string</span><span style=\"font-size:13px\"> mypath = </span><span style=\"font-size:13px;color:#2b91af\">Path</span><span style=\"font-size:13px\">.Combine(folder, fileName);\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">string</span><span style=\"font-size:13px\"> extension = </span><span style=\"font-size:13px;color:#2b91af\">Path</span><span style=\"font-size:13px\">.GetExtension(mypath);\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">if</span><span style=\"font-size:13px\"> (extension == </span><span style=\"font-size:13px;color:#a31515\">&quot;.pdf&quot;</span><span style=\"font-size:13px\"> || extension == </span><span style=\"font-size:13px;color:#a31515\">&quot;.jpg&quot;</span><span style=\"font-size:13px\"> || extension == </span><span style=\"font-size:13px;color:#a31515\">&quot;.zip&quot;</span><span style=\"font-size:13px\">)\r\n<p>&nbsp;</p>\r\n<p>{</p>\r\n<p>args.CopyTo(mypath);</p>\r\n<p>zipFileName = fileName;</p>\r\n<p>&nbsp;</p>\r\n<p>}</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">else</span><span style=\"font-size:13px\"> </span><span style=\"font-size:13px;color:#0000ff\">if</span><span style=\"font-size:13px\">(extension == </span><span style=\"font-size:13px;color:#a31515\">&quot;.mp3&quot;</span><span style=\"font-size:13px\"> || extension == </span><span style=\"font-size:13px;color:#a31515\">&quot;.m4a&quot;</span><span style=\"font-size:13px\">)\r\n<p>&nbsp;</p>\r\n<p>{</p>\r\n<p>Ionic.Utils.Zip.</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#2b91af\">ZipFile</span><span style=\"font-size:13px\"> file = </span><span style=\"font-size:13px;color:#0000ff\">new</span><span style=\"font-size:13px\"> Ionic.Utils.Zip.</span><span style=\"font-size:13px;color:#2b91af\">ZipFile</span><span style=\"font-size:13px\">(Response.OutputStream);\r\n<p>&nbsp;</p>\r\n<p>file.AddFileStream(args.FileName, </p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#a31515\">&quot;&quot;</span><span style=\"font-size:13px\">, args.OpenStream());\r\n<p>&nbsp;</p>\r\n<p>file.ForceNoCompression = </p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">true</span><span style=\"font-size:13px\">;\r\n<p>&nbsp;</p>\r\n<p>zipFileName = fileName + </p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#a31515\">&quot;.zip&quot;</span><span style=\"font-size:13px\">;\r\n<p>&nbsp;</p>\r\n<p>file.Save(mypath + </p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#a31515\">&quot;.zip&quot;</span><span style=\"font-size:13px\">);\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>}</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#0000ff\">else\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<span style=\"font-size:13px\">\r\n<p>{</p>\r\n<p>Ionic.Utils.Zip.</p>\r\n</span>\r\n<p><span style=\"font-size:13px;color:#2b91af\">ZipFile</span><span style=\"font-size:13px\"> file = </span><span style=\"font-size:13px;color:#0000ff\">new</span><span style=\"font-size:13px\"> Ionic.Utils.Zip.</span><span style=\"font-size:13px;color:#2b91af\">ZipFile</span><span style=\"font-size:13px\">(Response.OutputStream);\r\n<p>&nbsp;</p>\r\n<p>file.AddFileStream(args.FileName, </p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#a31515\">&quot;&quot;</span><span style=\"font-size:13px\">, args.OpenStream());\r\n<p>&nbsp;</p>\r\n<p>zipFileName = fileName + </p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#a31515\">&quot;.zip&quot;</span><span style=\"font-size:13px\">;\r\n<p>&nbsp;</p>\r\n<p>file.Save(mypath + </p>\r\n</span></p>\r\n<p><span style=\"font-size:13px;color:#a31515\">&quot;.zip&quot;</span><span style=\"font-size:13px\">);\r\n<p>&nbsp;</p>\r\n<p>}</p>\r\n</span></p>\r\n",
    "PostedDate": "2008-12-14T11:53:22.813-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "141150",
    "ThreadId": "42230",
    "Html": "I found the answer in this topic:<br>\r\n<a href=\"http://www.codeplex.com/DotNetZip/Thread/View.aspx?ThreadId=39117\">http://www.codeplex.com/DotNetZip/Thread/View.aspx?ThreadId=39117</a><br>\r\n<br>\r\nOnce I changed the temp path, it worked fine.\r\n",
    "PostedDate": "2008-12-16T15:58:50.91-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]