I have a script which, given an ID, kicks off some complex processes and puts an RTF file onto stdout
. For example, you might call it with something like foo.exe 27
to point it at ID 27.
Now I'd like to write a short PHP page which:
- accepts a GET
id
parameter - checks that the parameter is an integer number
- calls
shell_exec(...)
on the script (we'll assume it's on the$PATH
) - responds with the output of the script, popping up the usual browser-specific download prompt, just as if they'd clicked on the file in a link
Can this be done easily?