User (Old forums)MemberMarch 24, 2005 at 9:04 amPost count: 23064
I am dynamically creating a ZIP file on the fly with the ZIP component using ASP.NET and saving the file to a directory on the server. I then write the file to the browser as we do with all our files in the application. I have neved had files corrupted on the download before until now, and that includes ZIP files.
Maybe I am doing something wrong. Here is the code I use to create the zip file.
Xceed.Zip.Licenser.LicenseKey = “XXXX-XXXXX-XXXXX-MY-KEY”
szFileName = oAuth.UserID & “_” & Year(Now) & Month(Now) & Day(Now) & Format(CDate(Now), “hh_mm_ss”) & “.zip”
szZipFile = oSys.AppSettings.Item(“FPath”) & “ZIP\” & szFileName
oZipArchive = New Xceed.Zip.ZipArchive(New Xceed.FileSystem.DiskFile(szZipFile))
For I = 0 To _colZipItems.Count – 1
oFile = New FT.Repository.File(_colZipItems.GetByIndex(I), True)
oDiskFile = New Xceed.FileSystem.DiskFile(szPath & “\” & oFile.FileName)
oDiskFile = Nothing
This method sets a filename and path property which I use after this zip is created.
oApp = oApp.Current
oApp.Response.ContentType = “application/zip”
oApp.Response.AppendHeader(“content-disposition”, “attachment; filename=” + Name)
The zip file is created on the server and IS VALID, but the download about 80% of the time will give the user a “Corrupted Zip File” error, even though the actual Zip file is not corrupt.
Imported from legacy forums. Posted by AECInnovations (had 3807 views)User (Old forums)MemberAugust 5, 2005 at 12:07 pmPost count: 23064
Did you ever find a solution for this problem? I am encountering the same thing.
Imported from legacy forums. Posted by Scott (had 253 views)
- You must be logged in to reply to this topic.