Page 1 of 1

Creating a directory browser

Posted: Mon Oct 27, 2003 10:13 pm
by filch
Hello all,

I am trying to create a function to be able to browse a directory, change directories and select a file and be able to store that selection path in a variable for storage in a database. The key for me is to be able to store a path to a directory (no file selection) and also then chose the file, and thus have it's file path available for storage in a DB.

I have come up with ways to list the files in a directory, but what I do not know how to do is create the ability to "BROWSE" the directories. For instance, if I want to upload a file to the server, I want to be able to browse to and choose where I want to upload the file. If I want to add a path to an image to a database, I want to be able to "BROWSE" to the file, select it and have it's path stored in a variable and then it could be stored in the DB.

Again, getting a directory list is not so hard ... browsing seems to be eluding me. I am relatively new to PHP so that might be a clue why ... but hey ... I'm trying ;-)

Can someone point me in the right direction?

Dave

Posted: Mon Oct 27, 2003 10:17 pm
by McGruff
Take a look at the opendir(), readdir() and pathinfo() fns.

Posted: Mon Oct 27, 2003 11:07 pm
by m3rajk
if i see how you browse i might be able to offer a suggestion on how to capture the path.