Here we provide an asp.net multi-file upload code (complete instance), and this is a file upload code compatible with multiple browsers.
Here we provide an asp tutorial. net multi-file upload code (complete instance), and this is a file upload code compatible with multiple browsers.
Webpage special effect code
<Script type = "text/Webpage effects">
Var attachname = "uploadfile ";
Var I = 1;
Function addinput (){
If (I> 0 ){
Var attach = attachname + I;
If (createinput (attach ))
I = I + 1;
}
}
Function deleteinput (){
If (I> 1 ){
I = I-1;
If (! Removeinput ())
I = I + 1;
}
}
Function createinput (nm ){
Var aelement = document. createelement ("input ");
Aelement. name = nm;
Aelement. id = nm;
Aelement. type = "file ";
Aelement. size = "50 ";
If (document. getelementbyid ("upload"). appendchild (aelement) = null)
Return false;
Return true;
}
Function removeinput (nm ){
Var aelement = document. getelementbyid ("upload ");
If (aelement. removechild (aelement. lastchild) = null)
Return false;
Return true;
}
</Script>
Asp.net tutorial File
<Div style = "text-align: center">
<Div style = "width: 200px;">
<Input type = "file" size = "50" name = "file"/>
<Span id = "upload"> </span>
<Br/>
<Input type = "button" name = "button" value = "add file" onclick = "addinput ()">
<Input type = "button" name = "button" value = "delete file" onclick = "deleteinput ()">
</Div>
<Div style = "margin: 10px 0 10px 0; width: 200px;">
<Asp: button runat = "server" text = "Upload" id = "btnupload" onclick = "btnupload_click"> </asp: button> <br/>
<Asp: label id = "strstatus" runat = "server"> </asp: label>
</Div>
</Div>
1 2