Asp.net multi-file upload code (complete instance) (1/2)

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.