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

利用jQuery实现多文件上传

2010-03-19 15:09 337 查看
protected void btnUpload_Click(object sender, EventArgs e)
{
try
{
// 获取文件列表
HttpFileCollection hfc = Request.Files;
for (int i = 0; i < hfc.Count; i++)
{
HttpPostedFile hpf = hfc[i];
if (hpf.ContentLength > 0)
{
hpf.SaveAs(Server.MapPath("MyFiles") + "\\" +
System.IO.Path.GetFileName(hpf.FileName));
Response.Write("<b>文件: </b>" + hpf.FileName + " <br/> <b>大小:</b> " +
hpf.ContentLength + " <br/> <b>类型:</b> " + hpf.ContentType + " 上传成功! <br/>");
}
}
}
catch (Exception ex)
{

}
}

利用jQuery实现文件上传功能
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: