Rename file name as user friendly when zip files

Dec 4, 2009 at 5:28 PM

I have a requirement to download multiple files from UI in 2.0 I have gridview with selection of files as check box that loads from database.When i load the grid  i have file name as nice name but when

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  in grid i show user as nice name(100023-HM-jpeg)

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.


 i am using following code.



<font size="2" color="#0000ff"><font size="2" color="#0000ff">


</font></font><font size="2" color="#0000ff">



filesToInclude As New System.Collections.Generic.List(Of String)()


 filePath = Path.Combine("C:\Upload")  'where real images are uploads like with file name as (img1.jpeg)

<font size="2">



For Each item As AjaxFileInfo In Session("Checked")



Dim filerow As DataRow = SampleDB.ExecuteDataRow("select * FROM dbo.TSK_TASK_UPLOAD_IMAGES WHERE Row_key={0}", item.Rowkey)"\" & DirectCast(filerow("IMAGE_FILENAME_ORG"), String))



' is my real name i want to add when zip file is save



 Dim enc As Ionic.Zip.EncryptionAlgorithm = Ionic.Zip.EncryptionAlgorithm.None

enc = Ionic.Zip.EncryptionAlgorithm.WinZipAes256

<font size="2">



im c As System.Web.HttpContext = System.Web.HttpContext.Current <font size="2">




Dim archiveName As String = String.Format("archive-{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss")) <font size="2">

Response.ContentType =



Response.AddHeader("content-disposition", "filename=" + archiveName)<font size="2">




Using zip As New Ionic.Zip.ZipFile()

zip.Encryption = enc

<font size="2">





<font size="2">






<font size="2">












<font size="2">







Dec 5, 2009 at 12:58 PM

I can't understand what you're asking.

Also, I'm not a good source for help on gridviews, checkboxes, uploads, and downloads.

I can help you with only specific questions or problems relating to DotNetZip.

If you ask a specific question about DotNetZip, I may be able to help.