ホームページ  >  記事  >  ウェブフロントエンド  >  Jquery Uploadify は、進行状況を示す簡単な例をアップロードします。 bar_jquery

Jquery Uploadify は、進行状況を示す簡単な例をアップロードします。 bar_jquery

WBOY
WBOYオリジナル
2016-05-16 17:00:281048ブラウズ

コードをコピー コードは次のとおりです:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UpLoad.aspx.cs" Inherits="UploadifyDemo_UpLoad" %>



    Jquery Uploadify上传带进度条
   
   
   
   
   


   


   


   

   


   




上传|
取消上传





复制代码代码如下:

<%@ WebHandler Language="C#" Class="UploadHandler" %>

System を使用;
System.Web を使用;
System.IO を使用;

public class UploadHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Charset = "utf-8";

HttpPostedFile file = context.Request.Files["Filedata"];
string UploadPath = HttpContext.Current.Server.MapPath(@context.Request["folder"]);

if (file != null)
{
if (!Directory.Exists(uploadPath))
{
Directory.CreateDirectory(uploadPath);
}
ファイル。 SaveAs(Path.Combine(uploadPath, file.FileName));
context.Response.Write("1");
}
else
{
context.Response.Write(" 0");
}
}

public bool IsReusable
{
get
{
return false;
}
}
}

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。