Currently I have a byte[] that contains all the data of an image file, just want to build an instance of HttpPostedFileBase so that I can use an existing method, instead of creating a new overload one.
public ActionResult Save(HttpPostedFileBase file)
public ActionResult Save(byte[] data)
{
//Hope I can construct an instance of HttpPostedFileBase here and then
return Save(file);
//instead of writing a lot of similar codes
}
Create a derived class as follows:
Now you can pass instance of this class where HttpPostedFileBase is expected.