Skrypt wyglada tak, moze jakies sugestie co do tego co zmienic?
Kod
if ($file <> ""){
$filename = $file; // the name the file will have on client computer
$file_to_download= "files/".$file; // the name the file has on the server (or an FTP or HTTP request)
$user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
header( "Content-type: application/force-download" );
if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, "win")))) {
header( "Content-Disposition: filename=".$filename);
} else {
header( "Content-Disposition: attachment; filename=".$filename);
}
header( "Content-Description: File Transfer");
@readfile($file_to_download);
}
$filename = $file; // the name the file will have on client computer
$file_to_download= "files/".$file; // the name the file has on the server (or an FTP or HTTP request)
$user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
header( "Content-type: application/force-download" );
if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, "win")))) {
header( "Content-Disposition: filename=".$filename);
} else {
header( "Content-Disposition: attachment; filename=".$filename);
}
header( "Content-Description: File Transfer");
@readfile($file_to_download);
}