Get The File Published Status In SharePoint

SharePoint Object Model has the lot of enumeration properties that helps to identify the information of the SharePoint object. Here, we are going to see the property, which will help us to identify the Published status of the file, which is uploaded in the library.

Server Object Model

SPFile.Level property is used to get the publishing status of a SPFile object in SharePoint.

Returns the SPFileLevel enumeration.

Client Object Model

File.Level property is used to get the publishing status of a File object in SharePoint.

Returns the FileLevel enumeration

This level property returns any one of the three enumeration values, based on the File Published status.

Member Key Member Value Description
Published 1 Published version of the file
Draft 2 Draft version of a file
Checkout 255 File is checked-out to user