Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display "my computer"

Status
Not open for further replies.

andreas57

Technical User
Sep 29, 2000
110
CH
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?

thanks

andreas owen
aowen@swissonline.ch
 
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:

<input type='file' onchange='window.textField.value=this.value' />

...and let the user browse to the file name themselves. Then you can put the file name wherever you want.

--Dave
 
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é.

--Dave
 
I hate ActiveX. Is there a sloppier concept in existence?

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top