Chinaunix
标题:
请大神看看什么问题 上传图片总是失败
[打印本页]
作者:
大雄666
时间:
2016-11-24 19:15
标题:
请大神看看什么问题 上传图片总是失败
HttpPostedFileBase file = Request.Files["filename"];
if (file != null)
{
var fileName = Path.Combine(Request.MapPath("~/Content/Upload"), Path.GetFileName(file.FileName));
try
{
file.SaveAs(fileName);
ViewBag.G = "../Content/Upload/" + Path.GetFileName(file.FileName);
}
catch
{ }
}
else
{ return Content("上传失败"); }
作者:
大雄666
时间:
2016-11-24 19:16
请各位大神指教 在线等
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2