FiddlerScript to download 206 response content

1 posts, 0 answers
  1. Dsek
    Dsek avatar
    1 posts
    Member since:
    Mar 2014

    Posted 03 Apr 2017 Link to this post

    Hi,

    I am trying to download a 206 response type content such as mp4.

    I am able to use the below code. But when i try to open the file it says it got corrupted.

    FiddlerApplication.BeforeResponse += delegate(Fiddler.Session oS)
                {
                  if ((oS.responseCode == 200) && (oS.responseBodyBytes.Length > 1000))
                  {
                    string sMIME = oS.oResponse.MIMEType.ToLower();
                    if (sMIME.StartsWith("audio/") ||
                        sMIME.StartsWith("video/") ||
                        sMIME.Contains("media"))
                    {
                        oS.utilDecodeResponse();
                        oS.SaveResponseBody();                  
                    }
                  }
                };

    Please help

     

    Thanks,

    Dhana

Back to Top