For SharePoint, when we want our third party Java app to access the files from within document libraries, we currently grab files using HTTP get request.

But if the file is too large, it won't work.

Is there a way to get a file's size by URI with a single rest call?

  • 2
    something like /_api/web/lists/getByTitle('Document Library')/Files?$select=Size ? Nov 9, 2016 at 18:54

3 Answers 3


You can use below rest api to get file size without downloading file...


You will get one node with below name which will return file size....

<d:vti_x005f_filesize m:type="Edm.Int32">1003</d:vti_x005f_filesize>

The Files endpoint might be of use:

/_api/web/lists/getByTitle('Document Library')/Files?$select=Size

When I ran it against an arbitrary library, it indicated a lot of 0 file sizes, so ymmv.

You can call an endpoint like Siddharth shows. In the results of the call I've indicated, there is an endpoint to call for the specific file. It will look something like:


So you could call the initial Files endpoint I referenced, then depending on what you are doing, call the individual file endpoint for further information

  • Does that work for a single file? Please advise. Nov 9, 2016 at 23:03
  • added some more information Nov 10, 2016 at 14:26

You can get the size of the file from the HTTP headers too.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.