Wednesday, 2 March 2011

Got a problem trying to download docs over SSL?

Had the old problem trying to download streamed documents over SSL yesterday hear are the headers I needed to send to fix the php script

header("Content-Type: $mimeType");
header("Expires: " . Date("r"));
header("Pragma: ");
header("Cache-Control: public, must-revalidate");
header("Content-Length: " . strlen("$buffer}"));
header("Content-Disposition: attachment; filename=$filename");

Some people have reported that just setting the pragma header works for them but I needed all of these headers.