Hi All..

I'm using the following script to give the option to either "SAVE" or "OPEN" a file, via headers() function.
I'd like disable the "OPEN" option -- does anybody know if this is possible? So that the script only offers the option of saving the document...


Thanks for all your help over the years!

Well you forgot to include the script,
but you dont have that much control
the user can do whatever they want on the users pc, which is where the file ends up
Even when the user saves the file,
the download window will prompt to open on completion
unless 'close this dialog when complete' is checked

<?php if(!$file) return false;
header("Content-disposition: attachment; filename=$file");
header("Content-type: $filetype");
readfile("$file");
?>

<a href=savefile.php?filename=filename&filetype=filetype'>Save this file</a>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.