Witam, próbowałem zmienić nazwę pliku i pobrać go...
O to mój kod:
//First, see if the file exist
if (!is_file($name)) { die("<b>404 File not found!</b>"); } //Gather relevent info about file
//This will set the Content-Type to the appropriate setting for the file
switch( $file_extension ) {
case "sta": $ctype="text/plain";
break;
default: $ctype="text/plain";
}
//Begin writing headers
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer");
//Use the switch-generated Content-Type
header("Content-Type: $ctype");
//Force the download
@$header="Content-Disposition: attachment; filename=".$filename."";
header("Content-Transfer-Encoding: binary"); header("Content-Length: ".$len);
I pisze: File not found.
Wie ktoś, jak to poprawić?