当前位置: 移动技术网 > IT编程>开发语言>.net > asp.net web大文件上传带进度条实例代码

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

2018年04月20日  | 移动技术网IT编程  | 我要评论

梅洛普,望江网,wow战略论

复制代码 代码如下:

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();
}

}
}

打包源码下载

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网