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.