rtcary;11019437 wrote:Is there a way to examine the header before executing the readfile()?
What do you mean "examine"? You can always test your code by viewing the headers that actually get sent by your webserver when you access the script in your browser. (At least, you can if your browser supports viewing raw HTTP responses - most halfway decent browsers do.)
rtcary;11019437 wrote:When the file is not found, the above code does not display an error screen. Is there a better way to handle the error?
What do you mean by "not found"? You must not mean "the file doesn't exist", since your code would result in a 404 error in that case. If you can describe the exact error scenario you're trying to handle, the answer is most likely yes, there's a good way to handle that condition gracefully.
rtcary;11019437 wrote:As suspected, IE, Safari and Firefox give the User a choice of playing or saving the file. Chrome does not. Is there a tweak for Chrome so that it will ask?
Not sure what you mean by "as suspected", but... have you tried switching to the "application/octet-stream" content type header (e.g. the one that is currently commented out)?
EDIT: By the way... when posting code, please use the board's [noparse]
..
[/noparse] bbcode tags as they make your code much easier to read and analyze.