Uploadify ASP. NET USE Notes

Source: Internet
Author: User

<script type= "Text/javascript" src= "Jquery.uploadify.min.js" ></script

<link rel= "Stylesheet" href= "Uploadify.css" type= "Text/css"/>
<script type= "Text/javascript" > $ (document). Ready (function (){$ (' #uploadify '). Uploadify ({' swf '):' uploadify.swf ', ' buttontext ': ' Loading ', ' uploader ': ' Uploadhandler.ashx ', ' Queueid ': ' Filequeue ', ' queuesizelimit ': Ten, ' auto ': false, ' multi ': FAL SE, ' removecompleted ': true, ' filesizelimit ': ' 100MB ', ' filetypedesc ': ' Excel                    File ', ' filetypeexts ': ' *.xls ', ' onuploadsuccess ': function (file, data, response) { Layer.closeall ();layer.open ({type:1, Skin: ' Layui-layer-rim ',//Add border area: [' 520px ', ' 340px '],//Wide height Content: ' <div>file Name: ' + file.name + data + ' </div> '}); }, ' Onuploaderror ': function (event, Queueid, Fileobj, Errorobj){Layer.closeall (); }, ' Onuploadstart ': function (file){$ ("#uploadify"). Uploadify ("Settings", "FormData", {' ddlregion ':$ (' #ddlRegionSearch '). Val ()});            Dynamic parameters}); $ (' #supload '). Click (function supload (){$ (' #uploadify '). Uploadify (' upload ', ' * '); });    }); </script>
  <Div>    <inputtype= "File"name= "Uploadify"ID= "Uploadify" /><ButtonID= "Supload"class= "BTN">Start uploading</Button>  </Div>  <DivID= "Filequeue"></Div>

 Public voidProcessRequest (HttpContext context) {context. Response.ContentType="Text/plain"; Context. Response.Charset="Utf-8"; Httppostedfile file= Context. request.files["Filedata"]; stringUploadpath = context. Request.mappath ("/upload/files/"); Try    {    if(File! =NULL)    {        stringFileName = Uploadpath +file.        FileName; if(!directory.exists (Uploadpath))        {directory.createdirectory (Uploadpath); }        //uploading files to the serverfile.        SaveAs (FileName); Context. Response.Write ("<br>the Import is complete!"); }    Else{context. Response.Write ("<br>file loading failure!"); return; }    }    Catch(Exception ex) {context. Response.Write ("<br>exception:"+Ex.    Message); }}

Uploadify ASP. NET USE Notes

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.