【发布时间】:2011-12-12 17:15:28
【问题描述】:
在我的 MVC 应用程序中,我使用以下代码上传文件。
型号
public HttpPostedFileBase File { get; set; }
查看
@Html.TextBoxFor(m => m.File, new { type = "file" })
一切正常..但我正在尝试将结果字段转换为字节[]。我该怎么做
控制器
public ActionResult ManagePhotos(ManagePhotos model)
{
if (ModelState.IsValid)
{
byte[] image = model.File; //Its not working .How can convert this to byte array
}
}
【问题讨论】:
标签: arrays image asp.net-mvc-3