如果要将HttpPostedFile类型的对象发送到某个操作,则可能会在操作中获得null对象。那么如何发送呢?
答案 0 :(得分:-1)
为此,您可能需要通过Temp Data发送HttpPostedFile。有关示例,请参阅以下内容:
HttpPostedFileBase file;
TempData["FilePosted"] = file;
在行动中,这样做:
HttpPostedFileBase file = (HttpPostedFileBase)TempData["FilePosted"];