Operations: Attachments: How to Get an Attachment
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;
}
Parameters |
|
|
documentId |
string |
ID of a document which will contain an attachment |
name |
name |
Name of an attachment |
type |
AttachmentType |
Document or Revision |
changeVector |
string |
Entity changeVector, used for concurrency checks (null to skip check) |
Return Value |
|
Stream |
Stream containing an attachment |
ChangeVector |
Change vector of an attachment |
DocumentId |
ID of document |
Name |
Name of attachment |
Hash |
Hash of attachment |
ContentType |
MIME content type of an attachment |
Size |
Size of attachment |
Example
store.Operations.Send(new GetAttachmentOperation("orders/1-A",
"invoice.pdf",
AttachmentType.Document,
changeVector: null));