aspnet2014-07-10 01:19:20 3346
网页图片的上传很多地方都会用到,非常重要,实现方式也有很多,这里介绍一个比较交单的,ASP.NET作为后台的文件上传。
ASP.NET代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MieMie
{
public partial class LegendsFileHandler : System.Web.UI.Page
{
string uploadFolder = "Paht/";
protected void Page_Load(object sender, EventArgs e)
{
HttpFileCollection files = Request.Files;
if (files.Count == 0)
{
Response.End();
}
string path = Server.MapPath(uploadFolder);
HttpPostedFile file = files[0];
if (file != null && file.ContentLength > 0)
{
string savePath = path "/" Request.Form["fileName"];
file.SaveAs(savePath);
}
}
}
}彭亚欧个人博客原创文章,转载请注明出处
文章关键词:ASP.NET文件传送 Flex和ASP.NET的文件传送
文章固定链接:https://www.pengyaou.com/legendsz/server/aspnet/NzM=.html
上一篇 Jquery多种图片轮滚特效
下一篇 JqueryCombox选择框