![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Aug 2005
Posts: 66
Rep Power: 0
![]() |
Allow user to select a directory
Hi all!
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! ![]()
__________________
Isn't that just the way life goes? If it's worth doing, it's NP-Hard. Todd Wareham - Memorial University of Newfoundland |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 4
![]() |
Only way I can think of is with a Java Applet.
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Aug 2005
Posts: 66
Rep Power: 0
![]() |
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!
__________________
Isn't that just the way life goes? If it's worth doing, it's NP-Hard. Todd Wareham - Memorial University of Newfoundland |
|
|
|
|
|
#4 |
|
Expert Programmer
|
Why not Java Script?
__________________
|
|
|
|
|
|
#5 | |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 4
![]() |
Quote:
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
|
#6 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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. |
|
|
|
|
|
|
#7 |
|
Unverified User
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0
![]() |
You could just have the user type in the directory.
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted. Got 'Nux?—GNU/Linux and other free software support. It's GNU/Linux, not just Linux. |
|
|
|
|
|
#8 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#9 |
|
Programmer
Join Date: Aug 2005
Posts: 66
Rep Power: 0
![]() |
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. >.<
__________________
Isn't that just the way life goes? If it's worth doing, it's NP-Hard. Todd Wareham - Memorial University of Newfoundland |
|
|
|
|
|
#10 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Perhaps I'm wrong. I don't think you have your ducks all in a row. But fire away, Gridley, ammo's cheap.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|