Hi @Fabio Brandão ,
Below is my sample code to upload files to document library, hope it helps you:
string filepath = @"C:\temp\test.txt" ;
FileCreationInformation newfile = new FileCreationInformation();
byte[] FileContent = System.IO.File.ReadAllBytes(filepath);
newfile.ContentStream = new MemoryStream(FileContent);
newfile.Url = "test.txt";
Folder library = context.Web.GetFolderByServerRelativeUrl("/sites/michael/Shared%20Documents");
Microsoft.SharePoint.Client.File uploadfile = library.Files.Add(newfile);
context.Load(uploadfile);
context.ExecuteQuery();
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.