Есть два скрипта. 1- закачивает с формы файл на сервер
req.open("POST", url, true); req.setRequestHeader("Content-Type", "application/octet-stream"); + reader.readAsBinaryString(f);
после чего сохраняется в файле. 2 скрипт отдает файл
header('Content-Description: File Transfer'); header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document'); header("Content-Disposition: attachment; filename='$ fileName"); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($ fileName)); echo readfile($ fileName);
Но при скачивании ворд пишет что файл поврежден, что может быть, что делать?