"Derek Fountain" <no****@hursley .ibm.com> wrote in message
news:3f******** *************** @freenews.iinet .net.au...
I asked this a couple of days ago, but got no response. Surely it's not
difficult?
I have a file, which my PHP has created, called say, /tmp/fred.txt. I want
to send that file to the user so a dialog pops up and they get to save
'fred.txt' (or whatever they name it) on their local disk.
How do I do that?
You probably didn't get an answer first time around because your question is
perhaps more suited to HTML or Javascript newsgroups... It doesn't matter if
your file was created with PHP or otherwise - Unless you have your web
browser configured otherwise, a file is a file and will be served to the
client web browser accordingly...
However... I believe you can force some web browsers to open up a save as
box... but it is not guaranteed to work on all browsers.
One solution though might be to locate the file somewhere in your document
root (ie where you store your html files) and then just provide a
hyperlink... that should do it... if not, then try your question at one of
the other newsgroups that I have suggested for better response...