If you want to send an object of type HttpPostedFile to an action, you may get null object in the action. So how to send it?
Asked
Active
Viewed 258 times
1 Answers
-1
To do this, you may need send HttpPostedFile via Temp Data. For a sample, see the following:
HttpPostedFileBase file;
TempData["FilePosted"] = file;
And in the action, do this:
HttpPostedFileBase file = (HttpPostedFileBase)TempData["FilePosted"];

halfer
- 19,824
- 17
- 99
- 186

Mohsen Abasi
- 2,050
- 28
- 30
-
1Hi there. Please refrain from adding "be a Muslim to success" and "in the name of Allah" to your questions and answers. I have edited this from your material before, and I'd wouldn't like to think you are giving me work to do deliberately. – halfer Dec 29 '16 at 21:52