Is there a way from Ready APi to download a file using groovy script, and place it in my local directory?
ie., when i hit a URL the excel file download automatically when it get downloads it must get stored into my local directory path. and to download the file authorization is required, so how to pass the authorization?
Thanks in Advance.
Solved! Go to Solution.
Yes i have assigned the value for the custom property and now i am getting the response as.
"message" : "You must specify only one folder in the url for POST requests."
Thank for trying.
But you should try it out on your own instead of just try what is mentioned.
From the error message it is clear that what you are hitting is not a file url, instead a directory.
Your question is to download a file. Isn't it?
Even you could try the your in your browser. And see.
Automation is important, but priority is to understand how things work manually and find the right way to achieve and then think of automating it. Thank you.
Thanks for the update, When i try manually hitting the url in browser, it downloads the excel file under downloads folder. i have already tried this manually before.
So, Please let me know whether we can achieve it using readyAPi?
I am member like you, explore the problems, see what works and suggest some solutions as part of that in spare time.
You may feel free to check with SmartBear customer support.
By the way, I can see the file downloaded in the temp directory(check attachments tab below response editor) when this is tried.
Note, Download Resources checkbox ticked.
Explore what you are doing differently.
Thanks for the Information, I done get with the dynamic URL, with the HTTP method, Now i am getting the raw response as below, but i am not seeing any attachments tab under response, I am not sure where the file got downloaded. Do you have any idea where the file got downloaded?
and i dont see any difference the url which i am posting in the browser and the dynamic url. only thing before i was doing POST request. for HTTP Request
HTTP/1.1 200 OK
Date: Mon, 01 Jun 2020 05:34:41 GMT
Content-Disposition: attachment; filename=testing_AutoAPI_Dev_7505_20200601.xlsm
Last-Modified: Mon, 01 Jun 2020 05:24:47 GMT
Cache-Control: public, max-age=43200
Expires: Mon, 01 Jun 2020 17:34:41 GMT
Thanks for the detailed explanation, I have already checked whether the file is available in my local directory with the name, but i haven't found any file with the name and i have checked the preferences also there is no directory mentioned.