I am here again. There is a little problem with downloading
Code is :
$file_extension = strtolower(substr(strrchr($filename,"."),1));
if( $filename == "" )
{
echo "ERROR: download file NOT SPECIFIED. ";
exit;
} elseif ( ! file_exists( $filename ) )
{
echo "ERROR: File not found. ";
exit;
};
switch( $file_extension )
{
case "pdf": $ctype="application/pdf"; break;
case "exe": $ctype="application/octet-stream"; break;
case "zip": $ctype="application/zip"; break;
case "doc": $ctype="application/msword"; break;
case "xls": $ctype="application/vnd.ms-excel"; break;
case "ppt": $ctype="application/vnd.ms-powerpoint"; break;
case "gif": $ctype="image/gif"; break;
case "png": $ctype="image/png"; break;
case "jpeg":
case "jpg": $ctype="image/jpg"; break;
case "txt": $ctype="text/plain";break;
default: $ctype="application/force-download";
}
$emrfiletype = $type[$file_extension];
I get in doc files:
c:/style/style.css does not exist
and in gif or jpg files no image is displayed althoug they are downloaded
π