how can I programm a button so that when clicked should open the save as dialogue box?
Put simply, how can I save a file on the local machine using javascript or php? I really don’t know how to go about it.
Thanks in Advance.
EDIT:
Thanks for the quick response. I have a table that I have displayed on a web page, and a button, so that when that button is clicked, the user can specify the file path, and save that table as a .txt file to the specified destination.
In PHP, you can set the
Content-Dispositionheader toAttachment, which will tell the browser that the content being served is an attached file, which is to be downloaded:EDIT
To better fill the requirements of your updated question, you want to create a PHP-file that serves the table in the format you want it to be downloaded.
And then have your save button point to that pdf file