前端代码:
<form><input type='file' name='file' /></form>
请求接口代码:
public void upFile(HttpPostedFileBase file)
{
using (System.IO.BinaryReader sr = new BinaryReader(file.InputStream))
{
byte [] fileByte = sr.ReadBytes(file.ContentLength);
}
}