Hello Chitranjan Mallick,
Refer the below code :
Method 1 :
ListItem item = uploadedFile.ListItemAllFields;
item["Name"] = "NewName";
item.Update();
// use OverwriteCheckIn type to make sure not to create multiple versions
uploadFile.CheckIn(string.Empty, CheckinType.OverwriteCheckIn);
ctx.ExecuteQuery();
Method 2 :
SPSite oSite = new SPSite ("http://<sitename>/");
SPWeb oWeb = oSite.OpenWeb();
SPList oList = oWeb.Lists["Shared Documents"];
SPListItem oListItem = oList.Items[0]; //taking the first list item
oListItem.File.CheckOut();
oListItem["Name"] = "xyz";
oListItem.Update();
oListItem.File.CheckIn("file name has been changed");
oWeb.Dispose();
Hope this will help you.
Regards,
Nirav Lalan
DNS Gold Member
"If you can dream it, you can do it."