Got this exception "org.nuxeo.runtime.transaction.TransactionRuntimeException" when trying to upload around ~4mb file as blob.
DirectoryInfo di = new DirectoryInfo(@"E:\Temp\1\Patriotic_Menu_1Sided");
FileInfo[] imageFiles = di.GetFiles("*.jpg");
var imgFile = imageFiles.FirstOrDefault();
Blob uploadedFileBlob = new Blob(imgFile.Name, imgFile);
var document = (Document)client.Operation("FileManager.Import")
.SetInput(uploadedFileBlob)
.SetContext("currentDocument", "/default-domain/workspaces/POC/")
.Execute()
.Result;
FileInfo[] otherFiles = di.GetFiles("*.*");
otherFiles = otherFiles.Where(file => file.Extension != ".jpg" && file.Extension != ".zip").ToArray();
if (otherFiles.Count() > 0)
{
BlobList blobs = new BlobList();
foreach (var file in otherFiles)
blobs.Add(new Blob(file.Name, file));
var attachedDocuments = client.Operation("Blob.Attach")
.SetInput(blobs)
.SetParameter("document", document.Path)
.SetParameter("xpath", "files:files")
.Execute()
.Result; //exception occur here
}
0 votes
0 answers
1550 views