JQuery Ajax File Upload instance source _jquery

Source: Internet
Author: User

This example for you to share the jquery Ajax File upload Instance source code for your reference, the specific contents are as follows

Project structure

Default.aspx
Upload.aspx
scripts/...
Style.css

Effect chart

Client HTML code

<%@ Page language= "vb" autoeventwireup= "false" codebehind= "UploadFile.aspx.vb" inherits= "Web.uploadfile"%> ;! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

Service-side processing code upload.aspx

 Using System; 
Using System.Collections.Generic; 
Using System.Linq; 
Using System.Web; 
Using System.Web.UI; 
Using System.Web.UI.WebControls; 
 
Namespace Jqueryajaxuploadtest 
{public 
  partial class Upload:System.Web.UI.Page 
  { 
    protected void Page_Load (object sender, EventArgs e) 
    { 
      try 
      { 
        httppostedfile hpffile = request.files["UploadFile "]; 
        Hpffile.saveas (Server.MapPath ("~/uploads/") + hpffile.filename); 
        Response.Write ("Success"); 
      } 
      catch (Exception) 
      { 
 
        Response.Write ("fail"); 
      } 
  }} 


The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.