上传,uploader,服务器端代码怎么写
2018-01-04 · 知道合伙人软件行家
关注
展开全部
string dirPath = Server.MapPath("~/Temp/");
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
string filePath = dirPath + DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".jpg";
HttpPostedFileBase file = Request.Files[0];
file.SaveAs(filePath);
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
string filePath = dirPath + DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".jpg";
HttpPostedFileBase file = Request.Files[0];
file.SaveAs(filePath);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询