This project is read-only.

Life after downloading a ZIP

Aug 16, 2011 at 10:27 AM
Edited Aug 16, 2011 at 10:29 AM


I'm making a Sharepoint 2007 Webpart which is showing files from a documentlibrary and you you can download them in a ZIP file.
There is a button to download the selected files, but the button works only once.
There are some links (a href) in the webpart and they are still working, though.
I clear the header in the code, so it could be that my postback function is gone.
What is the right way to solve this?

Here is a snip of my code for downloading the ZIP file:

 // clear the Response contents and headers

 // set new headers and mime type
 Page.Response.AddHeader("content-disposition", "attachment; filename=" + zipName + ".zip");
 Page.Response.ContentType = "application/zip";

 // output the zip archive to the response stream

 // end the response


Aug 24, 2011 at 1:10 PM


Aug 24, 2011 at 5:18 PM
Edited Aug 24, 2011 at 5:21 PM

qwerty I looked at your code and your question.  Nothing in your dotnetzip code looks askew.

I don't know why "it works only once".  I suspect there is something else in your webpage logic that is leading to that situation.  The dotnetzip code looks ok.

I also deleted my previous message, the one where I scoffed at your impatience - how embarassing!  I thought you had asked twice in one day, but in fact you had asked the question a week ago and got no answer, and only posted a followup now.  I apologize.  I was mistaken.

good luck.  

Aug 27, 2011 at 7:59 PM
Edited Aug 29, 2011 at 6:01 PM

Hi Cheeso, No worries!

I'm thinking of redirecting to a different page and save the zip locally. Than a link will get the zip file so I don't have to push it to the end user.
I'm thinking my postback function is gone in the header of my page after using the ClearHeaders method.

Thanks all.