Does anyone know how to do this?
Forexample, if i use the following to print a txt file or MP3 file as an attachment to the browser, IE auto opens the file (either media player, or text docs are saved to a temp directory and open in notepad) but i've seen some scripts where this doesn't happen. I just don't know how to solve the problem
everything after this just prints the file attachment.
Forexample, if i use the following to print a txt file or MP3 file as an attachment to the browser, IE auto opens the file (either media player, or text docs are saved to a temp directory and open in notepad) but i've seen some scripts where this doesn't happen. I just don't know how to solve the problem
PHP Code:
header("Content-type: application/octet-stream");
header("Content-Disposition: inline; filename=\"".$name_mb."\"");
header("Content-length: ".(string)(filesize($path_mb)));
header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+2, date("i"), date("s"), date("m"), date("d"), date("Y")))." GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
Comment