So, I have a php front end to a SQL database. I would like for the administrator account to have a simple button that when gets pressed, a "Save as..." box opens, and a backup of the data base is then downloaded onto the client's hard drive.
Similarly, a second button would use open up an "Open file" dialog box, and upload the backup to "restore" the database.
I have no idea where to even begin searching for how to do these things. Everything I've seen involves linking to static files. I can manually backup and restore the data base through the shell, it shouldn't be too hard to for me to do that, it's just the file management I need help with.
Thanks.
--Dave
Down- and uploading files.
Moderator: General Moderators
Re: Down- and uploading files.
Well for upload you need..... http://php.net/file_upload
For downloads... you just need correct headers on downloading the file. I am sure there is tons of stuff online.
In general you can do stuff in two stpes... first is generate backup button... that will exec some mysqldump for example and store file
Then script will see this file..and offer download button.
On way back same storry. upload stuff... then commit resotre button. But with the restore you should be carefull...Should check recommended way of restoring.
Of course there might be much more elegant ways...but thats a start.
Although I doubt this web approach on such sensitive matter is a good solution altogether.
For downloads... you just need correct headers on downloading the file. I am sure there is tons of stuff online.
In general you can do stuff in two stpes... first is generate backup button... that will exec some mysqldump for example and store file
Then script will see this file..and offer download button.
On way back same storry. upload stuff... then commit resotre button. But with the restore you should be carefull...Should check recommended way of restoring.
Of course there might be much more elegant ways...but thats a start.
Although I doubt this web approach on such sensitive matter is a good solution altogether.