Hi all.
I have some problem. I upload to the Vault server files, but thumbnail not show's. I can get thumbnail of current document, but how i can attach my thumbnail to file iteration?
Thank you.
The Vault Server automatically extracts the thumbnail for known file types. If the server doesn't know how to read the thumbnail, then there is no way to set the thumbnail property.
Well for example I can Update File Properties:
System.Drawing.Size size = new System.Drawing.Size(200, 200);
Stream image = new MemoryStream(System.IO.File.ReadAllBytes("D:\\123.jpg"));
long[] fileIDs = new long[1];
fileIDs[0] = file.EntityMasterId;
VDF.Vault.Currency.Properties.PropertyDefinition prop = Statics.Connection.PropertyManager.GetPropertyDefinitionBySystemName("Thumbnail");
long[] propIDs = new long[1];
propIDs[0] = prop.Id;
ThumbnailInfo thumbnailInfo = new ThumbnailInfo(ThumbnailInfo.ThumbnailType.Thumbnail, System.IO.File.ReadAllBytes("D:\\123.jpg"));
object[] img = new object[1];
img[0] = thumbnailInfo.Image;
Statics.Connection.WebServiceManager.DocumentService.UpdateFileProperties(fileIDs, propIDs, img);
But on last line i have error with code "0". It's because I use Vault Basic or am I doing something not right? If I have a Vault Professional I can do so Thumbnail that will appear in the Vault or not?
I've got a lot of TIF images (old scanned drawings) some of them have a Thumbnail, the most of them don't. Its strange that an raster image doesn't have an thumnail.
Now we're on Vault 2015 and they want to use the Thin Client so no thumbnail becomes an issue.
I've created this code:
Dim tmpimg As String = "C:\temp\thumb.wmf" 'Resize the image to 256x256 pixels
Dim imgs As System.Drawing.Image = ShellFile.ResizeImage(System.Drawing.Image.FromFile(dest), 256, 256) imgs.Save(tmpimg, System.Drawing.Imaging.ImageFormat.Wmf) imgs.Dispose()
'Set up a new thumbnailinfo Dim thumbnailinfo As New VDF.Vault.Currency.Properties.ThumbnailInfo(0, System.IO.File.ReadAllBytes(tmpimg)) 'Creating a new dictionary that contains the value for the new thumbnail
Dim dict As New Dictionary(Of ACW.PropDef, Object) dict.Add(ThumbnailDef, thumbnailinfo.Image)
'update the thumbnail
'the error is generated here Dim veu As IExplorerUtil = ExplorerLoader.LoadExplorerUtil(VLT_Conn.Server, VLT_Conn.Vault, VLT_Conn.UserID, VLT_Conn.Ticket) veu.UpdateFileProperties(fle, dict) veu = Nothing
The only problem is that I get this error:
"At least one property failed to update"