![]() |
Allow user to select a directory
Hi all! :D
I've got a web page where I want the user to be able to select a directory so that my script can preform actions on that directory. The problem is that the only form input that I'm aware of that lets a user do something similar to this would be the :
<input type="file" />tag. However, this will not allow the user to select a directory...it seems that it HAS to be a file. Is there any other tag or method I can use to let the user of the web page select a directory? (I'm using python as the cgi if that makes any difference to the method.) Thanks in advance! :D |
Only way I can think of is with a Java Applet.
|
Java Applet, eh? So create an applet to prompt the user with a search box and then use that to submit the form?
Tricky...or at least it might be....I've programmed in Java but I've never done so with applets before. Well...at least it's a possible solution. ^_^ I'll look into it more. Thanks Agent 47! |
Why not Java Script?
|
Quote:
|
Quote:
Generally speaking, there isn't an easy way to manipulate a directory from a website. Browsers are designed specifically to stop that sort of potentially malicious tampering. The only way to get around it is to use a third-party plugin, like Java, although most popular plugins have extensive security measures designed to prevent access to the local filesystem. |
You could just have the user type in the directory.
|
Quote:
|
My bad, I should have been more specific. ;)
It's not the web script that will be preforming the actions on the directory. It will basically be a script that python is going to call that will do a change uid to that user and then do things with the directory. (More actually, zip certain files and send a copy of that zip file to the server). I know my audiece and they are (or at least will be) aware that the web page is going to zip up some files from their directory. As for having the user type in the directory....that goes back to knowing the audience. For the people who live in the linux world..they don't even need the browser...the can just run the script via command line from local/bin. However...I'm making this for the windows people that need a gui...and thus I don't think they'd like needed to "type in" a directory...although mabye if I find a way to do tab completion. Anyhow...there dosen't seem to be any easy way to get the user to just browse and select a directory....this is going to be a problem. >.< |
Perhaps I'm wrong. I don't think you have your ducks all in a row. But fire away, Gridley, ammo's cheap.
|
| All times are GMT -5. The time now is 1:51 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC