我在HttpPostedFileBase上有个错误
无法找到类型或命名空间名称‘HttpPostedFileBase’(您是缺少使用指令还是程序集引用?)
我已经试过使用using System.Web了,但根本没用。
编辑#1
public IActionResult Upload(HttpPostedFileBase file)
{
if (file.contentlength > 0)
{
var filename = Path.GetFileName(file.filename);
var path = Path.Combine(Server.mappath("~/app_data/uploads"), filename);
file.saveas(path);
}
return RedirectToAction("index");
}我没有引用文件夹无参考资料夹
https://stackoverflow.com/questions/50908031
复制相似问题