I am trying to upload a large file to an SP online site using the StartUpload, ContinueUpload and FinishUpload methods on the File class as given in the link below. https://msdn.microsoft.com/en-us/pnp_articles/upload-large-files-sample-app-for-sharepoint .

The code is provided below.

using (MemoryStream s = new MemoryStream(buffer))
         // Call the start upload method on the first slice.
        bytesUploaded = uploadFile.StartUpload(uploadId, s);
        // fileoffset is the pointer where the next slice will be added.
        fileoffset = bytesUploaded.Value;

I am getting an error

"'Microsoft.SharePoint.Client.File' does not contain a definition for 'StartUpload' and no extension method 'StartUpload' accepting a first argument of type 'Microsoft.SharePoint.Client.File' could be found (are you missing a using directive or an assembly reference?) \UploadSlicedFile\UploadSlicedFile\Program.cs".

T he Microsoft.Client dll version added in the solution is How do I fix this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.