Bhavesh Ghul

Bhavesh Ghul

  • 1.3k
  • 652
  • 21.4k

How to Fiddler Tool Test API Upload File withOther Parameter

Aug 21 2018 1:50 AM
public async Task<HttpResponseMessage> MediaUpload()
   if (!Request.Content.IsMimeMultipartContent("form-data"))
      throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
   var root = HttpContext.Current.Server.MapPath("~/Content/ProfileImgs/");
   if (!Directory.Exists(root))
   var provider = new MultipartFormDataStreamProvider(root);
   await Request.Content.ReadAsMultipartAsync(provider);
   int userid = Convert.ToInt32(provider.FormData["UserID"]);
Above Write Code in userid Value  is Null Get, This APi Test in fiddler tool and i test this that time two parameter pass in fiddler body & code see in fiddler body write and attach image
plz help me... 
Content-Disposition: form-data; name="UserID";
Content-Disposition: form-data; name="ProfilePicture"; filename="test.jpeg"
Content-Type: image/jpeg <@INCLUDE *C:\U

Attachment: Screenshot_(185).zip

Brought to you by:

Answers (1)