最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
jquery uploadify插件实现上传文件进度条效果
时间:2022-06-25 17:45:25 编辑:袖梨 来源:一聚教程网
一、jquery进度条代码:
css" rel="stylesheet" type="text/css" />
|
二、后端程序代码,产生jquery进度条的数据源:
using System;
using System.Web;
using 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);
}
file.SaveAs(Path.Combine(uploadPath, file.FileName));
context.Response.Write("1");
}
else
{
context.Response.Write("0");
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
相关文章
- 地下城堡4骑士与破碎编年史初光神官有哪些流派 09-17
- 嘟嘟脸恶作剧克萝伊技能怎么样 09-17
- 新三国志曹操传驯马场有什么玩法 09-17
- 全境封锁曙光武器怎么获取 09-17
- 鹅鸭杀丧葬者如何玩 09-17
- 剑与远征启程沙利叶强技能怎么样 09-17