views:

67

answers:

2

Users on my site have the option to download all the photos in an album as a zip file.The Zip file is dynamically created and saved to Response.OutPutStream to be detected as a file download on the user's browser.

Here is the Header and Content-type I am outputing

context.Response.AddHeader("Content-Disposition", "attachment; filename=Photos.zip");
context.Response.ContentType = "application/x-zip-compressed";

..Well everything works fine with every browser except FireFox. Although Firefox correctly detects the download as a Zip file, It saves the file without the .zip extension. I thought adding this header

context.Response.AddHeader("Content-Disposition", "attachment; filename=Photos.zip");

..is supposed to force FF to save the extension. I believe I am following the correct protocol so why is FF behaving this way and how do I fix this?

A: 

this may sount stupid, but are you shure the machine you are testing on have the option "hide common file extension" set to false?

vaitrafra
no I can see all my file extensions which means it is set to false.
The_AlienCoder
A: 

Put quotes around the name:

context.Response.AddHeader("Content-Disposition", "attachment; filename=\"Photos.zip\"");
cdm9002