您的位置:首页 > Web前端 > JQuery

使用jQuery实现多文件上传

2009-09-09 14:42 295 查看
前台代码
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace jQ_multiple_file_upload
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button1_Click(object sender, EventArgs e)
{
try
{
HttpFileCollection files = Request.Files;
for (int i = 0; i < files.Count; i++)
{
HttpPostedFile myfile = files[i];
if (myfile.ContentLength > 0)
{
myfile.SaveAs(Server.MapPath("MyFile") + "\\" + System.IO.Path.GetFileName(myfile.FileName));
}
}
}
catch(Exception ex)
{
throw ex;
}
}
}
}


源代码下载:jQ_multiple_file_upload
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: