'System.InvalidOperationException: Request format is invalid: multipart/form-data' error when posting image from iphone to .NET webservice

后端 未结 3 1807
南笙
南笙 2021-01-12 10:39

I\'m trying to post an image from an iphone app to a .Net webservice and I\'m running into this error. I\'ve already updated my web.config as per this kb article and I can

3条回答
  •  盖世英雄少女心
    2021-01-12 11:10

    You are trying to read binary data as input parameters. You need to instead read the parameters from Context.Request. In other words, remove userToken and image as Request Parameters. userToken should be instead accessed through Context.Request["userToken"] and image should be available through Context.Request.PostedFiles["image"]: http://www.rahulsingla.com/blog/2010/07/ext-net-ajax-file-upload-using-web-service

提交回复
热议问题