Solution | browser | upload | text box "problem": the browser Upload component consists of a text input box + a button that pops the selection file box, (pictured):
"Train of Thought":
Recently in the page to find a flaw is difficult to solve: I want to achieve this effect, users can only click to browse the selected file, but not to the selected file path or file name changes (otherwise the user directly arbitrary input or modify the string can upload, but this upload is empty meaningless files, so to do a qualification) , that is, the text input box should be similar to the disabled effect, but the upload component <input type= "File" > if the set disabled can not be uploaded, so think about it or through a workaround to achieve this effect. The final idea is to do a separate text input box set disabled to do the limit, and then set the transparency of the upload component to zero, in IE and FF test has passed!
"Code":
<title>::Test::upload::</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "Author" content= "Niko" >
<style type= "Text/css" >
body,td{font-size:12px;}
</style>
<body>
<form method= "POST" action= "enctype=" Multipart/form-data ">
<table width= "100%" border= "0" cellpadding= "0" cellspacing= "0" >
<tr>
<TD height= "450" ></td>
</tr>
<tr>
<td>
<table border= "0" cellpadding= "0" cellspacing= "0" align= "left" >
<tr align= "left" height= ">"
<TD width= > select File:</td>
<td>
<input id= "Txt_file" type= "text" style= "Width:220px;height:20px;background-color: #ffffff; border-top: #7F9DB9 1px Solid;border-left: #7F9DB9 1px solid;border-bottom: #7F9DB9 1px solid;border-right: #7F9DB9 0px solid; "disabled>
</td>
<TD width= "align=" left "style=" Background:url (uploadfile/2005-7/2005728174625830.gif) no-repeat-50px 0px! Important;background:url (uploadfile/2005-7/2005728174625830.gif) no-repeat-50px 1px; " >
<input name= "Upload" id= "up_file" "type=" File "style="-moz-opacity:0;filter:alpha (opacity=0); margin-left:-36px; ">
</td>
</tr>
<tr>
<TD colspan= "3" height= "5" ></td>
</tr>
<tr>
<td> File Description:</td>
<TD colspan= "2" ><input id= "Info_file" type= "text" style= "Width:342px;border: #7F9DB9 1px solid;" ></td>
</tr>
<tr>
<TD colspan= "3" height= "5" ></td>
</tr>
<tr>
<td><input type= "Submit" style= "WIDTH:58PX;" value= "Upload" ></td>
<TD colspan= "2" > Tip: Upload file size can not exceed 10.0 mb</td>
</tr>
<table>
</td>
</tr>
</table>
</form>
</body>