Bhavesh Ghul

Bhavesh Ghul

  • 821
  • 1k
  • 54.5k

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))
      Directory.CreateDirectory(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... 
 
---------------------------acebdf13572468
Content-Disposition: form-data; name="UserID";
14235
---------------------------acebdf13572468
Content-Disposition: form-data; name="ProfilePicture"; filename="test.jpeg"
Content-Type: image/jpeg <@INCLUDE *C:\U
 

Attachment: Screenshot_(185).zip

Answers (1)