I want to get a url that downloads the site usage reports in sharepoint 2013. I found the page that ends like


There I can click the link called usage and it downloads an excel file. But the problem is, how can I get a link that directly downloads the excel file.

The links seems to be javascript style which does a POST to the link above in order to get the file.

Does anyone know?


  • It does a POST because it generates the file (server side) on your request. So you have to do the exact same call yourself.. use F12 Dev console to see what event handlers are involved, then "go in" step by step... first question would be: Where does that ReportId come from? Feb 14 '17 at 15:47
  • It called this JS code javascript:ResetSpFormOnSubmitCalled();__doPostBack('__Page','ReportId=24fb1098-cede-4067-9e43-ec8d22063c1b'). I don't understand how to simulate the request though.
    – omega
    Feb 14 '17 at 15:52
  • You can't simulate the request it has to be the same, by the looks of it you have to include a security key as well. Then it is easier / cheaper to educate your users to do that extra click Feb 14 '17 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.