I asked for help 3 days ago on this same subject... I want to send a file to the user, and causing a download (any file extention), I got a piece of code....
function download($server_path){
$filename = $server_path;
$pos = strrpos($filename, "/") + 1;
$filename = substr($filename, $pos);
$mime_type = "binary/octetstream";
header("Content-Type: $mime_type");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Transfer-Encoding: binary");
header("Content-Description: my file");
passthru("cat $server_path");
}
but it doesn´t work... still sending the mambojambo code... can anyone still help me ?
NOTE: althought I also want to know how to do this, what I am trying to do is to send a zip file (mostly, but not always) (that will be downloaded) but I don´t want the user to see the location of the file on the server.
thankx
JP