5

I am currently using Sharepoint 2013 and am using this URI to get some basic metadata about the documents under the document directory: /_api/web/Lists/GetByTitle('Documents')/Items?$select=FileLeafRef,FileRef,Modified,FileSystemObjectType,GUID.

What I am looking for is to additionally get the MIME type or application type of a file though this call. I would think that simply adding another field such as FileType would suffice, but it doesn't seem so. Is there a way to get this information from this call?

If the MIME type cannot be retrieved from this call, is there a separate call I can make to get such information?

3
  • 2
    Note that SharePoint doesn't store any information about the MIME type of files, it's added by IIS during the request for a specific resource, mapped by file extension.
    – James Love
    May 21, 2016 at 13:18
  • Thank you, @JamesLove. Do you know of a field that I can add to my URI that just returns the file extension? May 23, 2016 at 19:59
  • 1
    Try DocIcon - it returns the extension to be used to shown the icon of the doc.
    – James Love
    May 24, 2016 at 9:47

1 Answer 1

1

To determine file type you could add File_x0020_Type or DocIcon to the list of selected properties, for example:

/_api/web/lists/getbytitle('<list title>')/items?$select=File_x0020_Type

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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