Custom text for file input
Is there a 开发者_JS百科way to change the text on a a file input in html?
This is the only possible solution i know of.
There are two ways.
Javascript
Flash
through javascript + css hack, you can do this as @Sarfaraz said. Another option is use flash. In that case you have more control.
That's not possible. That would have been a security hole. If that was possible, then everyone would be able to do this:
<form name="upload" action="upload" method="post" enctype="multipart/form-data">
<input type="file" value="c:/passwords.txt">
<input type="submit">
</form>
<script>document.upload.submit()</script>
True, you can mimic it with a plain input field as @sAc mentions, but it would still not point to the actual file.
精彩评论