In this SharePoint tutorial, we will discuss how we can resolve the below issue which comes while uploading files using CSOM (Client side object model (Microsoft.SharePoint.Client.dll)). The error comes as The file filename is not checked out. You must first check out this document before making changes.
Were trying to upload a few files to a document library using .Net managed object model code. But while uploading it gave the below error:
The file “https://SiteURL/Document_Library_Name/Archiving16.gif” is not checked out. You must first check out this document before making changes.
The file filename is not checked out
One solution is programmatically, you can first check out the file. But in our case we have checked in the document library, someone mistakenly enables “Create major and minor (draft) versions” in Document Version History.
So you can go to the Library Settings -> Versioning Settings and in the Versioning Settings page you can disable the Versioning or you can also create major versions like below:
Read some SharePoint online csom examples:
- Retrieve list content types using csom in SharePoint online or SharePoint 2013
- Delete content type from SharePoint online list using csom .net managed object model code
- How to retrieve ModerationStatus of the document using .Net managed object model csom code in SharePoint online?
- Retrieve content type id by content type name using client object model code SharePoint online
- Activate SharePoint Server Publishing Feature programmatically using C#.Net .net managed object model code
Then the error “The file filename is not checked out. You must first check out this document before making changes.” will not come.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.