I am uploading files on a SharePoint folder with this code:
var clientContext = GetClientContext();
var folderName = "Folder";
var fileName = @"C:\Users\user\Desktop\file.pdf";
folder = clientContext.Web.Folders.GetByUrl(clientContext.Url + '/' + folderName);
var info = new FileCreationInformation
{
ContentStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read),
Overwrite = false,
Url = clientContext.Url + '/' + folderName + '/' + Path.GetFileName(fileName),
};
file = folder.Files.Add(info);
folder.Update();
clientContext.Load(file, f => f.ListItemAllFields);
clientContext.ExecuteQuery();
clientContext.Load(file);
fileID = file.ListItemAllFields.Id;
And I see that they have no title once they get uploaded (they only have a name).
How can I set the Title too?