I am using the php to generate some html codes
It is in the now ,
<textarea>
<html>
....
</html>
</textarea>
what i would like to do is create a button ‘save as html’
When i press on it, it has a windows save as dialog, allow user choose the place to store,
then save to that place when confirm (the dialog should not be create by me, using the windows one.)
Is the workflow is : first i saved a temp html file in my server, then the user open dialog, (I do not need to worry about the ‘saving to part’ , just need to specific the temp html file path), and when the user close, i delete the temp file. So , how can it be realize? thanks
Thank you again.
PHP is on the server-side don’t forget. Once the page is generated, it is on the client. I think it makes more sense to do this sort of thing with javascript, although you could also post the data to a PHP page which would then obtain the data.
Send the ‘input’ data to a PHP page by POST method:
Receive it on the PHP end:
Then you could have a link in PHP to download the file.
After that you can delete the file from your server like this:
To open a save file dialog – redirect to the file, your browser should open up a save file dialog:
To view a preview of the file, make an iframe: