You are currently browsing legacy 5.0 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Operations: Attachments: How to Get an Attachment

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


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;
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


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