webservice上传文件 报错,大家帮我看看什么原因
System.InvalidOperationException: 请求格式无效: multipart/form-data; boundary=---------------------------131972902112614。
在 System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
在 System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
服务器端代码(webservice):
[WebMethod(Description = "上传截图并返回图片url")]
public void UpLoad(int userid)
{
HttpPostedFile hfc = Context.Request.Files["pic"];
}
客户端提交代码
<form id="fromdesign" method="post" enctype="multipart/form-data" action="/design.asmx/UpLoad" >
<div>
pic<input name="pic" id="pic" type="file" /> <p/>
<input type="submit" />
</div>
</form>