?
Solved

experts on INPUT TYPE=FILE

Posted on 2003-03-14
2
Medium Priority
?
180 Views
Last Modified: 2010-04-09
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
Comment
Question by:happyloman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 8137391
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
 
LVL 33

Accepted Solution

by:
knightEknight earned 300 total points
ID: 8137419
... 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question