Overwrite option

Apr 20, 2011 at 11:49 AM

Is there an option to do a overwrite for the tool? :D

Apr 21, 2011 at 10:29 AM

No, files are never overwritten

Apr 21, 2011 at 12:53 PM

What if I want to overwrite the files? Cos i just uploaded a bunch of files, and I would like to overwrite them with newer versions on my end.

Apr 21, 2011 at 4:01 PM

You can delete the items in the document library. 

Overwrite functionality was not implemented as it was not required at the time of development, but it should be fairly easy to implement.

Apr 17, 2014 at 11:32 AM
Edited Apr 17, 2014 at 11:34 AM
I got it to overwrite by changing the following-

In SharePointRepository.cs

Change to 'true' instead of 'shouldOverwrite'.
File.SaveBinaryDirect(context, serverRelativeFileUrl, stream, true);


In DefaultSharePointDestination.cs

Change the ImportFile method to-
public void ImportFile(ImportFile importFile)
    {
            Log.Info("START Processing " + importFile.OriginalFullName);
            var result = DocumentLibraryRepository.CreateFile(importFile);
            ExistingFilenames.Add(new NameSourcePair { Name = importFile.Name, Source = importFile.OriginalFullName });
            if (result.Succeeded)
            {
                RaiseItemProcessed(importFile, result.Location);
            }
    }