最新下载
热门教程
- 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;
}
}
}
相关文章
- 用 Electron 与 FastAPI 构建流式 Agent 对话 09-20
- JS中彻底删除JSON对象组成的数组中的元素 09-20
- JEV人工智能官网入口:Jev AI国内访问与申请教程 09-20
- 用蓝耘元生代搭建本地图库语义搜索:一句话定位目标图片 09-20
- 企业级 Agent 如何从提效走向增收:落地路径与实践解析 09-20
- Smarty的配置与高级缓存技术分享 09-20