Mam zaimplementowane pobieranie załączników. Na localhoście po http działa bez problemu natomiast przy https ssl po kliknięciu załącznika strona sie przeładowuje. Zakładam że jest to wina złej konfiguracji nagłówka. Proszę o rady, poniżej kod:
if ($byte_array_attachment != null) {
$random_string = 'upload/proj_temp'.substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 50), 1).substr(md5(time()), 1);
file_put_contents($random_string, $byte_array_attachment);
if (file_exists($random_string)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$fileName);
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: '.filesize($random_string));
readfile($random_string);
unlink($random_string);
exit;
} else {
header("Location: ?section=projects");
}
} else {
header("Location: ?section=projects");
}