Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

File Upload via CSOM is incrementing Version number by 2.

$
0
0

Any ideas why a file upload via CSOM is incrementing the version number by 2 instead of one?

I am using the following code to perform the upload

List library = clientContext.Web.Lists.GetByTitle(DOCUMENTS_LIST_NAME);
Folder folder = library.RootFolder;
FileCreationInformation fci = new FileCreationInformation();
Byte[] streamArray = new Byte[document.ContentLength];
document.InputStream.Read(streamArray, 0, document.ContentLength);
fci.Content = streamArray;

fci.Url = documentTypeID + "." + document.FileName.Split('.').Last<String>();
fci.Overwrite = true;

 File fileToUpload = folder.Files.Add(fci);
clientContext.Load(fileToUpload);
clientContext.ExecuteQuery();


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>