【发布时间】:2014-01-30 14:48:20
【问题描述】:
我正在使用 MVC 4 和 webAPI,需要使用文件上传控件上传图像。 我需要知道 WebAPI 中以下内容的替换:
int filelength = Request.Files[0].ContentLength;
byte[] databytes = new byte[filelength];
Request.Files[0].InputStream.Read(databytes, 0, filelength);
string filename = Path.GetFileName(Request.Files[0].FileName);
我的意思是我需要在 WebAPI 控制器中获取文件名和文件大小。
Request.Files 的任何替代方案?
【问题讨论】:
标签: asp.net asp.net-mvc-4