[
  {
    "Id": "263702",
    "ThreadId": "77139",
    "Html": "<p>I&nbsp;have a requirement to download multiple files from UI in vb.net 2.0 I have gridview with selection of files as check box that loads from database.When i load the grid&nbsp; i have file name as nice name but when</p>\r\n<p>when i read the files from physical folder it has different name like e.g when file was upload it upload as img1.jpeg and behind the seen i rename it as 100023-HM-jpeg so for download&nbsp; in grid i show user as nice name(100023-HM-jpeg)</p>\r\n<p>and when i zip files i read file from physical folder as img1.jpeg but when user save zip file i want to save file as nice name 100023-HM-jpeg.I try all possible values but no luck hope understand my issue.Can any one help me.</p>\r\n<p>thanks</p>\r\n<p>&nbsp;i am using following code.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p><span style=\"font-size:x-small\"><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;\r\n<p>Dim</p>\r\n&lt;/font&gt;&lt;/font&gt;</span>&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span>\r\n<p><span style=\"font-size:x-small\">filesToInclude </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">As</span></span><span style=\"font-size:x-small\"> </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">New</span></span><span style=\"font-size:x-small\"> System.Collections.Generic.List(</span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">Of</span></span><span style=\"font-size:x-small\"> </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">String</span></span><span style=\"font-size:x-small\">)()</span></p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;filePath = Path.Combine<strong>(&quot;C:\\Upload&quot;)&nbsp; 'where real images are uploads like with file name as (img1.jpeg)</strong></p>\r\n&lt;font size=&quot;2&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span></p>\r\n<p><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">For</span></span><span style=\"font-size:x-small\"> </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">Each</span></span><span style=\"font-size:x-small\"> item </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">As</span></span><span style=\"font-size:x-small\"> AjaxFileInfo </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">In</span></span><span style=\"font-size:x-small\"> Session(</span><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;Checked&quot;</span></span><span style=\"font-size:x-small\">)</span></p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">Dim</span></span><span style=\"font-size:x-small\"> filerow </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">As</span></span><span style=\"font-size:x-small\"> DataRow = SampleDB.ExecuteDataRow(</span><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;select * FROM dbo.TSK_TASK_UPLOAD_IMAGES WHERE Row_key={0}&quot;</span></span><span style=\"font-size:x-small\">, item.Rowkey)</span><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;\\&quot;</span></span><span style=\"font-size:x-small\"> &amp; </span><strong><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">DirectCast</span></span><span style=\"font-size:x-small\">(filerow(</span><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;IMAGE_FILENAME_ORG&quot;</span></span></strong><span style=\"font-size:x-small\"><strong>),</strong> </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">String</span></span><span style=\"font-size:x-small\">))</span></p>\r\n<p>&nbsp;</p>\r\n<p><span style=\"font-size:x-small\">\r\n<p>filesToInclude.Add(filePath)</p>\r\n<p><strong><span style=\"text-decoration:underline\">'item.name is my real name i want to add when zip file is save</span></strong></p>\r\n<p>Next</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;<span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">Dim</span></span><span style=\"font-size:x-small\"> enc </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">As </span></span><span style=\"font-size:x-small\">Ionic.Zip.EncryptionAlgorithm = Ionic.Zip.EncryptionAlgorithm.None\r\n<p>enc = Ionic.Zip.EncryptionAlgorithm.WinZipAes256</p>\r\n&lt;font size=&quot;2&quot;&gt;\r\n<p>&nbsp;D</p>\r\n&lt;/font&gt;</span></p>\r\n<p><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">im</span></span><span style=\"font-size:x-small\"> c </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">As</span></span><span style=\"font-size:x-small\"> System.Web.HttpContext = System.Web.HttpContext.Current &lt;font size=&quot;2&quot;&gt;\r\n<p>\r\n<p>&nbsp;</p>\r\n</p>\r\n&lt;/font&gt;</span></p>\r\n<p>\r\n<p>&nbsp;</p>\r\n<span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">Dim</span></span><span style=\"font-size:x-small\"> archiveName </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">As</span></span><span style=\"font-size:x-small\"> </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">String</span></span><span style=\"font-size:x-small\"> = </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">String</span></span><span style=\"font-size:x-small\">.Format(</span><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;archive-{0}.zip&quot;</span></span><span style=\"font-size:x-small\">, DateTime.Now.ToString(</span><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;yyyy-MMM-dd-HHmmss&quot;</span></span><span style=\"font-size:x-small\">)) &lt;font size=&quot;2&quot;&gt;\r\n<p>Response.ContentType =</p>\r\n&lt;/font&gt;</span>\r\n<p><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;application/zip&quot;</span></span></p>\r\n<p><span style=\"font-size:x-small\">Response.AddHeader(</span><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;content-disposition&quot;</span></span><span style=\"font-size:x-small\">, </span><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;filename=&quot;</span></span><span style=\"font-size:x-small\"> + archiveName)&lt;font size=&quot;2&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span></p>\r\n<p>&nbsp;</p>\r\n<span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">Using</span></span><span style=\"font-size:x-small\"> zip </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">As</span></span><span style=\"font-size:x-small\"> </span><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">New</span></span><span style=\"font-size:x-small\"> Ionic.Zip.ZipFile()\r\n<p>zip.Encryption = enc</p>\r\n&lt;font size=&quot;2&quot;&gt;\r\n<p>zip.AddFiles(filesToInclude,</p>\r\n&lt;/font&gt;</span>\r\n<p><span style=\"font-size:x-small;color:#a31515\"><span style=\"font-size:x-small;color:#a31515\">&quot;files&quot;</span></span><span style=\"font-size:x-small\">)\r\n<p>zip.Save(Response.OutputStream)</p>\r\n&lt;font size=&quot;2&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span></p>\r\n<p>&nbsp;</p>\r\n<span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">End</span></span><span style=\"font-size:x-small\"> </span></p>\r\n<p><span style=\"font-size:x-small;color:#0000ff\"><span style=\"font-size:x-small;color:#0000ff\">Using</span></span></p>\r\n<p><span style=\"font-size:x-small\">&lt;font size=&quot;2&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span>\r\n<p>&nbsp;</p>\r\n</p>\r\n<p>&nbsp;</p>\r\n<p><span style=\"font-size:x-small;color:#008000\"><span style=\"font-size:x-small;color:#008000\">Response.Close()</span></span></p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p><span style=\"font-size:x-small\">&lt;font size=&quot;2&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span></p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-12-04T09:28:37.807-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "263906",
    "ThreadId": "77139",
    "Html": "<p>I can't understand what you're asking.</p>\r\n<p>Also, I'm not a good source for help on gridviews, checkboxes, uploads, and downloads.</p>\r\n<p>I can help you with only specific questions or problems relating to DotNetZip.</p>\r\n<p>If you ask a specific question about DotNetZip, I may be able to help.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-12-05T04:58:56.003-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]