最新下载
热门教程
- 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;
}
}
}
相关文章
- 网红张雪峰死亡为何霸榜热搜,全平台哀悼?这个人是谁?干嘛的? 03-25
- 张雪峰猝死了真的假的?网传张雪峰猝死了是怎么回事? 03-25
- 张雪峰是干嘛的?张雪峰因为什么走红?心源猝紧该怎么急救? 03-25
- 张雪峰死亡原因揭秘:急速运动心源猝死 03-25
- 张雪峰今年多大呀?怎么会突然猝死了? 03-25
- 张雪峰死了真的假的?张雪峰死亡原因揭秘 03-25