I have a problem when downloading the file i've uploaded on my local server. The file is successfully downloaded, however there is a problem on opening the file that i've download.
For example i download a word file(.docx).
The error is : The office open XML file 'filename' cannot be opened because there are problems with the content. Word found unreadable content in 'my file.docx'.
and when i open the file on my download folder then on the file properties, there is something under the attribute says
"Security: This file came from another computer and might be block to help protect this computer." How can I also resolve that?? Please help
Here's my code for my download script
<?php
ob_start();
if(isset($_GET['file'])){
$file = $_GET['file'];
$path = "lesson/".$file;
header("Content-Disposition: attachment; filename=".$file);
header("Content-Type: application/pdf");#pdf
header("Content-Type: video/x-msvideovideo/x-msvideo");#avi
header("Content-Type: video/x-flv");#flv
header("Content-Type: video/mp4");#mp4
header("Content-Type: application/vnd.ms-powerpoint");#ppt
header("Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation");#pptx
header("Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document");#docx
while(ob_get_level()){
ob_end_clean();
}
readfile("lesson/".$file);
exit();
}
?>