Forum Moderators: coopster
The idea is to have a dropdown menu which lists all the database tables and an "Export" button which would open a "Save as" dialog where the user input the filename and path and upon clicking save the file is created.
My problem is that I cannot find a way to get that Save As dialog that will return the entire path the user has chosen and the filename to then submit it to the form to create the file.
<INPUT type="file"> does what what I need but it has a big text field attached to it which I dont want and also it doesn't seem to be possible to change the word "browse" from the button.
Has anybody got any ideas?
<INPUT type="file">
This is intended to upload a file from the local machine to the server, which I don't think you want to do.
I would have thought you'd need to generate and save the file entirely on the server (in fact you don't even need to save it) but then provide the file as a download (by sending the appropriate headers, or simply by providing a link if you have saved it). The user will then be presented with a standard download dialog, which should include the option to "save file" - this is your "Save As" dialog.
(You cannot save a file directly to the local machine using PHP as you seem to be implying? You need to present it as a download to the user. If you want to give the user the ability to "Save As..." the file somewhere on the server (careful with security) then you will need to create your own "Save As..." dialog as a regular HTML form.)