设为首页 - 加入收藏 站长在线 - 常用服务器软件 - 在线站长工具 - 在线伪原创工具
您的当前位置:主页 > 网络教程 > ASP.NET > 正文

asp.net web大文件上传带进度条实例代码

来源:ZzWww 编辑:ZzWww 时间:2018-12-26

复制代码 代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Collections.Generic;
using System.Web.Configuration;

public partial class upload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
// Get the data
HttpPostedFile jpeg_image_upload = Request.Files["Filedata"];

jpeg_image_upload.SaveAs(System.Web.HttpContext.Current.Server.MapPath("~/upload/") + jpeg_image_upload.FileName);

Response.StatusCode = 200;
Response.Write("文件处理完毕!");
}
catch
{
// If any kind of error occurs return a 500 Internal Server error
Response.StatusCode = 500;
Response.Write("未知错误!");
}
finally
{
// Clean up
Response.End();
}

}
}

打包源码下载http://www.52jbj.com/codes/6210.html


TAG标签:文件 asp.net Web 上传 进度

网友评论:

文章右边250
Top