Witam!
Mam kod pobierania:
//First, see if the file exists
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 "txt": $ctype="text/plain";
case "csv": $ctype="text/plain";
break;
default: $ctype="application/force-download";
}
//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);
No i oczywiście ob_start i ob_end_flush() nie braknie... ;]
Ale cały czas pobiera w txt... jak zmienić na sta ?