[SOLVED] direcotry select
Moderator: General Moderators
Ya, there's really no way to open a file browser to the server (HUGE security risk!!!). How dynamic is your file structure? Why are the pulldown menu's no longer a viable option? Granted, you have to hard-code in each directory, but couldn't you automate that task by storing the paths in a db and add an entry to the table when, say, a user uploads or makes a new directory, or some other action?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
eh.. I was trying to load some data in from some CDs that were either going to be copied onto the server or stuck in the CD slot. The data exists in multiple directories on the CD so I thought if they could choose their CD or data directory, I could just recurse down the dir structure and read the data in automatically... They just have to tell me where they put it and the Dir name...
I got this script from another forum and it works really well. You can see it work here and if you click on a file you can see the link at the top right to download the files. I used the "browse" function of this program and tweaked it a bit to make it work for me. The major thing I had to change was the use of $_SERVER['DOCUMENT_ROOT']. It doesn't seem to work for IIS. plus, I wanted to start at the root, not at Inetpub/wwwroot. But the rest of it works great thanks to Matthew Wilkin.
- sharyn
- sharyn