i want fetch a filename from my hard drive or mappen drives and use the name in a form, just the name and not the file. has anyone a idea how i could do that?
Gee, I always hate saying that something can't be done, because my experience is that is usually NOT the case, but here I find myself saying it for the 2nd time today.
Your desire for the file name might be innocent enough, but such functionality could easily be used for more sinister purposes.
So, no. Not with HTML and JavaScript ...not unless you do something like:
Well Dave, you could potentially set up some cool thingy where you have
1) a file input and
2) a text input positioned directly over the file input.
You could have the browse button visible, the text input over the file input's text area. On the file field's onchange event, you could parse the file name out with JavaScript (something like String.split("/")) and then populate the text box with the file name.
I didn't feel like looking into the large amounts of CSS and x-browser functionality, however, since I'm lazy. Now that I've brought this up, though, I may need to.
*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
Yeah, that's along the lines of what I said COULD be done, but I got the impression that andreas57 was more interesting in having the JavaScript scan someone's drive for a particular file and populate the form with that file name WITHOUT THE USER DOING ANYTHING.
Too invasive a procedure for JavaScript, though ActiveX might serve (if the user clicks an 'OK' button somewhere along the way). Not my forté.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.