• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

experts on INPUT TYPE=FILE

I have an INPUT of TYPE FILE, I don't want the "long name" to show.


BAD=> C:/MyDocuments/some Dir/other Dir/TheFILE.doc

GOOD=> TheFILE.doc


How can I get just "TheFILE.doc" to appear on the textfield after the user is finished clicking on the BROWSE button?

THANKS
0
happyloman
Asked:
happyloman
  • 2
1 Solution
 
knightEknightCommented:
Unless there is a tag attribute for this, you can't.  For security reasons, users cannot modify the value property of FILE input types.
0
 
knightEknightCommented:
... otherwise, someone might do something like this:

<BODY onload='document.forms[0].myfile.value="C:\windows\passwords.txt";document.forms[0].submit();>

<FORM action='stealpasswords.jsp'>
<INPUT type='file' name='myfile'>
</FORM>
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now