The uploading/syncing/etc functionality behaves fine but I am having issues with file properties. When uploading (code sample below) the files LastModified property is set to the time the file was uploaded. This is not the case if I directly Copy/Paste the file to the directory.
That makes sense. Try this, open a new instance of Windows Explorer, select a file, copy it, paste it. The created and accessed dates on the new file will be today's date & time, but the modified date will match the original.
When you upload a file, you're creating an entirely new copy without metadata, so the modified & created dates will match to today's date & time.
What you can do, once the file is on the server and you can get a handle to it, is to use File.SetLastWriteTime
to manually set the attribute. (See SetLastWriteTime documentation).
Hope that helps.
Edit 1: You can iterate over your file collection on Sharepoint and set attributes on new files by doing something like this:
var list = web.Lists[new Guid("...")];
var folderItem = list.RootFolder.SubFolders;
foreach (File f in files) {
var lastModifiedBy = context.Web.EnsureUser(f.LastModifiedBy);
var lastModified = f.LastModified;
SPFile uploadedFile = folderItem.Files.Add(f.FileName, f.Content, lastModifiedBy,
lastModifiedBy, lastModified, lastModified);
uploadedFile.Item["Created"] = lastModified;
uploadedFile.Item["Modified"] = lastModified;
uploadedFile.Item.UpdateOverwriteVersion();
}