Forum Moderators: open

Message Too Old, No Replies

script to browse files and return selected file & path

         

baze22

8:57 pm on Sep 4, 2006 (gmt 0)

10+ Year Member



I'm looking for a script that will allow the user to browse within a directory on the server, select a file, and that path/filename would be returned to an input box on a form. Hoping to find a good way to avoid user error when entering that info on a form. Any suggestions?

thanks,

baze

Nutter

6:27 pm on Sep 5, 2006 (gmt 0)

10+ Year Member



I've done something similar using a PHP script that's called from the JS - an AJAX type thing minus the XML. I'm pretty sure that just JS won't be able to read anything directly from the server.

Depending on how big of a grouping of files you're talking about you may be able to create a JS array using PHP code to contain all the files.

baze22

7:41 pm on Sep 5, 2006 (gmt 0)

10+ Year Member



I figured out that js wouldn't be able to do anything server side. I actually got something working. I'm using a php file manager. And I've modified it so that when a file name is clicked,

a) it calls via js the opener's function to set the input field and

b) closes the file manager.

thanks for the response,

baze