Page 1 of 1

Programatically Get File Attachment

Posted: Thu Dec 19, 2013 2:00 pm
by KCraver
We're using Vault Pro 5.1.2 and C# .NET

I have tried using the API to retrieve a file attachment on a Vault/Dragnet item, but the AttStream property of the MantisItemAttachmentFullDetail object is null. I presume this is because the API does not support serializing/deserializing files between the server and client.

I have also tried getting the FileContents field from the dbo.attachments table in the sgdragnet database, but the field uses a text data type which I haven't been able to properly convert to binary.

Can I get some advice on how to properly deserialize the text FileContents field into binary or how to use the API to retrieve a file attachment?

Re: Programatically Get File Attachment

Posted: Fri Dec 20, 2013 10:43 am
by jclausius
Attachment downloads are a little bit tricky. You'll need to know the message id (msgid) and the attachment id (attid). I believe if you have a collection of attachment items you can get the attid and the msgid. Once you have that info, you can use the Client Integration Helper library - ItemTrackingOperations.ProcessCommandDownloadFortressAttachment()
or
look at using ClientInstance.Connection.DownloadDragnetAttachment()