Provides a cass for uploading files to a Nuxeo server. Files can be uploaded as a whole or in several chunks.
No server-side error handling was implemented. If an upload job fails, a FailedToUploadException is thrown.
Example #1
0
 public void BatchUploadWithUploader()
 {
     uploader = client.Uploader().SetChunked(true).SetChunkSize(1024); // 1KB = 1024B
     Entity result = uploader.AddFile("Test.txt")
                               .AddFile("Puppy.docx")
                               .UploadFiles().Result;
     Assert.NotNull(result);
     Assert.True(result is EntityList<Entity>);
     Assert.Equal(2, ((EntityList<Entity>)result).Count);
 }
 private async Task Upload(string[] files, string destination)
 {
     StartProgressRing();
     Uploader uploader = new Uploader(client);
     uploader.AddFiles(files);
     try
     {
         await uploader.UploadFiles();
         await uploader.Operation("FileManager.Import")
                       .SetContext("currentDocument", currentDirectory.Path)
                       .Execute();
     }
     catch (Exception ex)
     {
         await DisplayError("Could not upload files.", ex);
     }
     await UpdateView();
     StopProgressRing();
 }