Streaming a zip file download to the client... RRS feed

  • Question

  • User-357897802 posted
    I have a zip file created by another process on the server and the zip file can be stored anywhere on the server. I want to stream that file to the browser for download without coping the file to a location within the web directory. How can i do this? Thanx, Alex
    Friday, January 28, 2005 10:11 AM

All replies

  • User1549685497 posted
    You can try something like this Response.ContentType = "applicatin/zip" Response.WriteFile(path) These commands can be used inside of a Handler, but do not need to be used in a handler.
    Friday, January 28, 2005 6:17 PM
  • User-357897802 posted
    Yea ... i figured out the problem... Heres the solution... Response.ClearHeaders() Response.ContentType = "application/x-zip-compression" Response.WriteFile(filePath) The part that I did NOT know about is when the page has any HTML other than the page directive... the Response.ClearHeaders() is required.
    Monday, January 31, 2005 8:49 AM