Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET ZIP Corruption Issues

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19455 |

    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))

    oZipArchive.BeginUpdate()
    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.CopyTo(oZipArchive, True)
    oDiskFile = Nothing
    Next
    oZipArchive.EndUpdate()

    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)

    oApp.Response.AppendCookie(oAuth.HttpCookie)
    oApp.Response.WriteFile(Path)

    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)
    Member
    Post count: 23064

    Did you ever find a solution for this problem? I am encountering the same thing.

    Thanks

    Imported from legacy forums. Posted by Scott (had 253 views)

    User (Old forums)
    Member
    Post count: 23064

    also want to know!

    Imported from legacy forums. Posted by zxr (had 3950 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.