目前我有一个byte[]
包含一个图像文件的所有数据,只是想构建一个HttpPostedFileBase
的实例,以便我可以使用现有的方法,而不是创造一个新的过载之一。如何创建一个HttpPostedFileBase实例(或其继承类型)
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
}
您是否得到了解析存储在byte []中的文件的答案? Mine保留内容处置等。 – Devela