08-29-2017 05:03 AM
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
}
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.