hello jim - thnaks for your responses!
they've helped out a little but movies, PSDs, mp3s (and other app files) dont work once downloaded?!?
my new code is;
$file = $server_path."/clientfolders/".$pth.$dw;
$ext = substr($file, strrpos($file, '.') + 1, strlen($file));
switch(strtolower($ext)) {
case "pdf": $ctype="application/pdf"; break;
case "exe": $ctype="application/octet-stream"; break;
case "zip": $ctype="application/x-zip-compressed"; 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 "mp3": $ctype="audio/mpeg"; break;
case "wav": $ctype="audio/x-wav"; break;
case "mpeg":
case "mpg":
case "mpe": $ctype="video/mpeg"; break;
case "mov": $ctype="video/quicktime"; break;
case "avi": $ctype="video/x-msvideo"; break;
//The following are for extensions that shouldn't be downloaded (sensitive stuff, like php files)
case "php":
case "htm":
case "html":
case "txt": die("<b>Cannot be used for ". $file_extension ." files!</b>"); break;
default: $ctype="application/force-download";
}
header('Content-type: '.$ctype);
header('Content-Disposition: attachment; filename='.$ctype."-".$dw);
header("Content-Length: ".filesize($server_path."/clientfolders/".$pth.$dw);
readfile($server_path."/clientfolders/".$pth.$dw);
and the switch seems to be pretty accurate. I've added $ctype to the beginning of the file so you can see what filetype it thinks it is.
the download list is here and the first content-type is via a mime_content_type request and the second is via the switch method(the one i'm using on the actual download script)
any pointers much appreciated! D.
http://78.136.37.132/clientfolders/dologin.php?usr=crabbe&passF=qwerty