Hi all,
I'm a bit of a newbie so here goes.
I've written a PHP application that reads a bunch of javascript array files, converts them into PHP arrays, loads them into a MySQL database and then, using PHP fwrite, creates new copies of the original javascript files.
All works fine and dandy, however, in the last step, when writing the new file copies, I want the user to be able to specify their local target directory location using a browse button as opposed to my hardcoding the target location with the script.
This sound simple, but I'm pulling my hair out here.
Can this be done???
Here's hoping.
Mike.
Target for PHP fwrite.
Moderator: General Moderators
Re: Target for PHP fwrite.
You want them to specify folder on the server or folder on computer.
In the first case you have to implement a file browser.
In the second, you cannot write JS on the client's computer. You can however set content-disposition: attachment HTTP header, and stream the JS file to the client.
In the first case you have to implement a file browser.
In the second, you cannot write JS on the client's computer. You can however set content-disposition: attachment HTTP header, and stream the JS file to the client.
-
mikefromBrighton
- Forum Newbie
- Posts: 2
- Joined: Mon Mar 22, 2010 5:41 am
Re: Target for PHP fwrite.
Thanks for the info Darhazer. This is basically an internal PHP program (maintaining some javascript arrays) using a browser as a user interface.
It all workks fine. I can already write the javascripts files ok. I can even specify their target folder from the browser by using an input field to capture the file path. My problem is that I want to determine the file path by browsing (similar to a file upload or download), instead of typing it in to the input field manually.
Hope this helps. Any assistance would be gratefully received.
Mike.
It all workks fine. I can already write the javascripts files ok. I can even specify their target folder from the browser by using an input field to capture the file path. My problem is that I want to determine the file path by browsing (similar to a file upload or download), instead of typing it in to the input field manually.
Hope this helps. Any assistance would be gratefully received.
Mike.