[SOLVED] direcotry select

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
sharyn
Forum Commoner
Posts: 33
Joined: Tue Jun 15, 2004 6:39 pm
Location: So Cal

Post by sharyn »

Feyd, hmmm... ok, I guess no familar dialog box for my users then :(
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can fake one with a popup and some nice icon graphics..
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

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.
User avatar
sharyn
Forum Commoner
Posts: 33
Joined: Tue Jun 15, 2004 6:39 pm
Location: So Cal

Post by sharyn »

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...
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Chances are, the users don't know exactly where the data is either. I'd suggest making your root/start page your CD drive, and let the user browse from there until the directory they want.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
sharyn
Forum Commoner
Posts: 33
Joined: Tue Jun 15, 2004 6:39 pm
Location: So Cal

Post by sharyn »

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
Post Reply