By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,925 Members | 725 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,925 IT Pros & Developers. It's quick & easy.

Directory "chooser" for HTML?

P: n/a
I have a particular need to an application . . .

I need users to specify a directory (with path) on their filesystem on
an HTML page. All I need at the server is a string representation of
the path they choose. No file upload. No file names.

Right now, I have users typing in full paths into an <input
type="text"/> element. I would rather a HTML control to allow
them browse to their selected directory. When they hit "OK", or
whatever, the path is stored for subsequent form submission. Then I
can have the value on the server to use.

I prefer IE solutions. I use HTML, JSP, Java, and JavaScript.
I am willing to use tag libraries, if relevant.
Thnak you for thinking about my plight.

badgerduke

Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

<ha******@chorus.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a particular need to an application . . .

I need users to specify a directory (with path) on their filesystem on
an HTML page.
Right now, I have users typing in full paths into an <input
type="text"/> element. I would rather a HTML control to allow
them browse to their selected directory.
<form name="formName" method="POST" action="yourcgi.(exe/php/asp/pl)">
<input type="file" name="fileName">
</form>
will allow the user to browse to a file.

document.forms['formName']['fileName'].value
will return the complete path if you want to parse it client side
When they hit "OK", or
whatever, the path is stored for subsequent form submission. Then I
can have the value on the server to use.
All I need at the server is a string representation of
the path they choose. No file upload. No file names.
I am assuming you have some kind of script in place to handle the form
data.
When the form is submitted fileName and its value will appear
on the server as one of the name/value pairs and you can parse
out whatever you need.>

I prefer IE solutions. I use HTML, JSP, Java, and JavaScript.
I am willing to use tag libraries, if relevant.
no need and should work in all browsers
HTH
Jimbo
Thnak you for thinking about my plight.

badgerduke

Jul 23 '05 #2

P: n/a

J. J. Cale wrote:
<ha******@chorus.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a particular need to an application . . .

I need users to specify a directory (with path) on their filesystem on an HTML page.
Right now, I have users typing in full paths into an <input
type="text"/> element. I would rather a HTML control to allow
them browse to their selected directory.
<form name="formName" method="POST"

action="yourcgi.(exe/php/asp/pl)"> <input type="file" name="fileName">
</form>
will allow the user to browse to a file.

document.forms['formName']['fileName'].value
will return the complete path if you want to parse it client side
When they hit "OK", or
whatever, the path is stored for subsequent form submission. Then I can have the value on the server to use.
All I need at the server is a string representation of
the path they choose. No file upload. No file names.
I am assuming you have some kind of script in place to handle the

form data.
When the form is submitted fileName and its value will appear
on the server as one of the name/value pairs and you can parse
out whatever you need.>

I prefer IE solutions. I use HTML, JSP, Java, and JavaScript.
I am willing to use tag libraries, if relevant.


no need and should work in all browsers
HTH
Jimbo
Thnak you for thinking about my plight.

badgerduke


Thank you for responding. The type="file" input tag requires a user
select a file. I do not want them to choose a file, just a directory.
I prefer to keep this particular input tag out of the file, since it is
misleading and is meant for uploads. I just want to be get the path of
the chosen directory to my server.

Jul 23 '05 #3

P: n/a
In article <11**********************@z14g2000cwz.googlegroups .com>,
ha******@chorus.net wrote:
The type="file" input tag requires a user
select a file. I do not want them to choose a file, just a directory.
I prefer to keep this particular input tag out of the file, since it is
misleading and is meant for uploads. I just want to be get the path of
the chosen directory to my server.


That control will not include any 'filepath' at all, just the file
chosen through it. Have visitors enter the filepath in a text control
(type="text") and have sufficient explaining added, preferrably with an
example.

So, in the end you know some filepaths. Then what?

--
Kris
<kr*******@xs4all.netherlands> (nl)
Jul 23 '05 #4

P: n/a
In article <11**********************@f14g2000cwb.googlegroups .com>,
ha******@chorus.net enlightened us with...
I need users to specify a directory (with path) on their filesystem on
an HTML page. All I need at the server is a string representation of
the path they choose. No file upload. No file names.
<snip>
I prefer IE solutions. I use HTML, JSP, Java, and JavaScript.
I am willing to use tag libraries, if relevant.
Thnak you for thinking about my plight.

IE only client-side solution using WSH see Shell.BrowseForFolder <URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/objects/shell/browseforfolder.asp>


You can use that with client-side javascript, jscript, or vbscript.

--
--
~kaeli~
Humpty Dumpty was pushed!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.