This is a migrated thread and some comments may be shown as answers.

Save specific file locally

3 Answers 342 Views
Windows
This is a migrated thread and some comments may be shown as answers.
yttooloolez
Top achievements
Rank 1
yttooloolez asked on 14 May 2019, 01:48 PM

Hello, im new here I just wanted to save a specific file with FiddlerScript but it seems not working what did I do wrong ?

public static void OnBeforeResponse(Session oSession)
{
    if (m_Hide304s && oSession.responseCode == 304)
    {
        oSession["ui-hide"] = "true";
    }
    if (oSession.url.Contains("/my.task/")) {
       var directory: String = "c:\\sources\\";
       var path: String = System.IO.Path.Combine(directory + ".json");
          oSession.utilDecodeResponse();
       oSession.SaveResponseBody(path);
    }
}

 

3 Answers, 1 is accepted

Sort by
0
yttooloolez
Top achievements
Rank 1
answered on 14 May 2019, 02:34 PM

My bad, response goes in document/fiddler2/ folder

How can I change that and rename the file ?

 

Thanks.

0
Accepted
Simeon
Telerik team
answered on 21 May 2019, 01:18 PM
Hello,

I have tried your example and the file was saved in C:\sources\.json Maybe you tried with the "c:\\Users\\%USERNAME%\\Documents\Fiddler2\" folder.

'How can I change that and rename the file ?' It should work with any filepath you are authorized to use and you should be able to use any valid filename.

Regards,
Simeon
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alex
Top achievements
Rank 1
answered on 29 Apr 2020, 03:23 PM

>>public static void OnBeforeResponse

BIG thanks! I really like your replay! I look it for a long time!

Tags
Windows
Asked by
yttooloolez
Top achievements
Rank 1
Answers by
yttooloolez
Top achievements
Rank 1
Simeon
Telerik team
Alex
Top achievements
Rank 1
Share this question
or