colorblindjimbo
In Runtime
- Messages
- 195
Hey guys,
I am writing a php webpage that will create a batch file for the user to download and run automatically.
I already have the page done to write to the batch file, and that is running great. I however, am running into a little bit of a problem with prompting the user to download the batch file.
Here is what I have so far for the page that makes them download the file.
This will have the user prompted to download the file, but does not give them the option to "OPEN" the file. Are there any Content-types that I can use that will give them the ability to choose to "OPEN" the file, and not just "SAVE" the file?
Or does anyone know of a list of acceptable Content-types?
Thanks.
I am writing a php webpage that will create a batch file for the user to download and run automatically.
I already have the page done to write to the batch file, and that is running great. I however, am running into a little bit of a problem with prompting the user to download the batch file.
Here is what I have so far for the page that makes them download the file.
Code:
<?php
header('Content-disposition: attachment; filename=rungame.bat');
header('Content-type: application/pdf');
readfile('rungame.bat');
?>
This will have the user prompted to download the file, but does not give them the option to "OPEN" the file. Are there any Content-types that I can use that will give them the ability to choose to "OPEN" the file, and not just "SAVE" the file?
Or does anyone know of a list of acceptable Content-types?
Thanks.