Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您想将 HttpPostedFile 类型的对象发送到操作,您可能会在操作中获得 null 对象。那么怎么寄呢?
为此,您可能需要通过 Temp Data 发送 HttpPostedFile。有关示例,请参阅以下内容:
HttpPostedFileBase file; TempData["FilePosted"] = file;
在行动中,这样做:
HttpPostedFileBase file = (HttpPostedFileBase)TempData["FilePosted"];