Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Zip file Download problem..

Zip file Download problem..

Scheduled Pinned Locked Moved ASP.NET
sysadminhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rain raj
    wrote on last edited by
    #1

    Hello Genious.. I have some word files on server.. that i need to download all of them together.. So i have only one option that first i create a zip file from all these files and then then download this zip file.. So my functionality achived. But when i extract these zip file and opens word any of word files within downloaded zip file, Opened Word file shows only byte data means some thing like lots of Sqaures which may be same as bytes of files.. and obeviously word file should display actual content in readable character.. Any Suggestons will appreciated... If needed the please refer to my code.. For i As Integer = 0 To strFileToDownload.Count - 1 Dim strFileName As String = Path.GetFileName(strFileToDownload(i)) Dim MyFileStream As FileStream = File.OpenRead(strFileToDownload(i)) Dim buff() As Byte = New Byte((MyFileStream.Length)) {} 'Dim zipEntry As New ZipEntry(strFileToDownload(i)) Dim zipEntry As New ZipEntry(strFileName) zipOS.PutNextEntry(zipEntry) zipOS.Write(buff, 0, buff.Length) zipOS.InitializeLifetimeService() MyFileStream.Close() Next ' Compress and close the zip file zipOS.Finish() zipOS.Close() Response.ClearContent() Response.ClearHeaders() Response.ContentType = "application/zip" Response.AddHeader("Content-Disposition", "attachment; filename=" + "CMM " + strProjectSize + " size Project Documents" + System.IO.Path.GetFileName(strNow)) Response.WriteFile(strNow) Response.Flush() Response.Clear()

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups