Skip to main content

Get Attachment Operation

This operation is used to get an attachment from a document.

Syntax

public GetAttachmentOperation(string documentId, string name, AttachmentType type, string changeVector)
public class AttachmentResult
{
public Stream Stream;
public AttachmentDetails Details;
}

public class AttachmentDetails : AttachmentName
{
public string ChangeVector;
public string DocumentId;
}

public class AttachmentName
{
public string Name;
public string Hash;
public string ContentType;
public long Size;
}
Parameter
documentIdstringID of a document which will contain an attachment
namestringName of an attachment
typeAttachmentTypeSpecify whether getting an attachment from a document or from a revision.
(Document or Revision).
changeVectorstringThe ChangeVector of the document or the revision to which the attachment belongs.
Mandatory when getting an attachment from a revision.
Used for concurrency checks (use null to skip the check).
Return Value
StreamStream containing an attachment
ChangeVectorChange vector of document
DocumentIdID of document
NameName of attachment
HashHash of attachment
ContentTypeMIME content type of an attachment
SizeSize of attachment

Example

store.Operations.Send(new GetAttachmentOperation("orders/1-A",
"invoice.pdf",
AttachmentType.Document,
changeVector: null));