Hello,
I wrote a php script to open a file using fopen in read mode.
I gave correct file name and even permissions are set to read n write, even-though the script is not able to open the file. But the scripts works fine for all files except .ppt files.
script:
$file_path = '../files/uploads/somthing.ppt';
if (!file_exists($file_path)) return ' Invalid File ';
$file = @fopen('./'.$file_path,"rb");
if ($file) {
while(!feof($file)) {
print(fread($file, 1024*8));
flush();
if (connection_status()!=0) {
@fclose($file);
report_error();
}
}
@fclose($file);
}
else echo 'Error';
this script returns "invalid file" for ppt files even though file exists but works fine for doc files..
I wrote a php script to open a file using fopen in read mode.
I gave correct file name and even permissions are set to read n write, even-though the script is not able to open the file. But the scripts works fine for all files except .ppt files.
script:
$file_path = '../files/uploads/somthing.ppt';
if (!file_exists($file_path)) return ' Invalid File ';
$file = @fopen('./'.$file_path,"rb");
if ($file) {
while(!feof($file)) {
print(fread($file, 1024*8));
flush();
if (connection_status()!=0) {
@fclose($file);
report_error();
}
}
@fclose($file);
}
else echo 'Error';
this script returns "invalid file" for ppt files even though file exists but works fine for doc files..