Hi,
We have a vpn account on hostwinds using whm / cpanel.
Hostwinds support recently upgraded the server to ea4. Since then we have had several issues with php scripts. Most are resolved but we cannot find a solution for an issue with a download script, specifically docx downloads. After downloading and opening, a popup appears saying the file is corrupted. All this used to work fine before the upgrade.
We tried and looked everywhere to no avail so far. Perhaps anyone here can help?
Thanks,
Raoul
We have a vpn account on hostwinds using whm / cpanel.
Hostwinds support recently upgraded the server to ea4. Since then we have had several issues with php scripts. Most are resolved but we cannot find a solution for an issue with a download script, specifically docx downloads. After downloading and opening, a popup appears saying the file is corrupted. All this used to work fine before the upgrade.
We tried and looked everywhere to no avail so far. Perhaps anyone here can help?
Code:
header("Content-Description: File Transfer");
if($ext == "docx"){
header("Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document");//application/pdf');
}else{
header("Content-type: application/octet-stream");//application/pdf');
}
header("Content-Transfer-Encoding: Binary");
header("Content-Disposition: attachment; filename=\"".$name."\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");
header("Content-Length: " . filesize($file));
//ob_clean();
//flush();
readfile($file);
Raoul