Skip to content

Commit f16ddc6

Browse files
authored
Merge pull request #2027 from reebhub/RDoc-3271_seekableAttachments
Document loading data range within an attachment
2 parents 8837eb0 + dbcc272 commit f16ddc6

File tree

10 files changed

+1285
-0
lines changed

10 files changed

+1285
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Attachments: Loading Attachments
2+
---
3+
4+
{NOTE: }
5+
Learn in this page how to load a part of an attachment, an entire attachment,
6+
or multiple attachments.
7+
8+
* In this page:
9+
* [Load attachments](../../document-extensions/attachments/loading#load-attachments)
10+
* [Load a part of an attachment](../../document-extensions/attachments/loading#load-a-part-of-an-attachment)
11+
12+
{NOTE/}
13+
14+
---
15+
16+
{PANEL: Load attachments}
17+
18+
* Use these methods to load attachments from the database.
19+
* **session.Advanced.Attachments.Get**
20+
Can be used to download an attachment or multiple attachments.
21+
* **session.Advanced.Attachments.GetNames**
22+
Can be used to download all attachment names that are attached to a document.
23+
* **session.Advanced.Attachments.GetRevision**
24+
Can be used to download an attachment of a revision document.
25+
26+
* Use this method to verify that an attachment exists.
27+
* **session.Advanced.Attachments.Exists**
28+
29+
## Syntax
30+
31+
{CODE-TABS}
32+
{CODE-TAB:csharp:Sync GetSyntax@DocumentExtensions\Attachments\Attachments.cs /}
33+
{CODE-TAB:csharp:Async GetSyntaxAsync@DocumentExtensions\Attachments\Attachments.cs /}
34+
{CODE-TABS/}
35+
36+
## Example I
37+
38+
{CODE-TABS}
39+
{CODE-TAB:csharp:Sync GetAttachment@DocumentExtensions\Attachments\Attachments.cs /}
40+
{CODE-TAB:csharp:Async GetAttachmentAsync@DocumentExtensions\Attachments\Attachments.cs /}
41+
{CODE-TABS/}
42+
43+
## Example II
44+
Here, we load multiple string attachments we previously created for a document. We then
45+
go through them, and decode each attachment to its original text.
46+
{CODE-TABS}
47+
{CODE-TAB:csharp:Sync GetAllAttachments@DocumentExtensions\Attachments\Attachments.cs /}
48+
{CODE-TAB:csharp:Async GetAllAttachmentsAsync@DocumentExtensions\Attachments\Attachments.cs /}
49+
{CODE-TABS/}
50+
51+
{PANEL/}
52+
53+
{PANEL: Load a part of an attachment}
54+
55+
Use `GetRange` to load a part of an attachment by document ID and the attachment name.
56+
57+
## Syntax
58+
{CODE:csharp GetRngSyntax@DocumentExtensions\Attachments\Attachments.cs /}
59+
60+
## Sample
61+
{CODE-TABS}
62+
{CODE-TAB:csharp:Sync GetRange@DocumentExtensions\Attachments\Attachments.cs /}
63+
{CODE-TAB:csharp:Async GetRangeAsync@DocumentExtensions\Attachments\Attachments.cs /}
64+
{CODE-TABS/}
65+
66+
{PANEL/}
67+
68+
## Related Articles
69+
70+
### Attachments
71+
72+
- [What are Attachments](../../document-extensions/attachments/what-are-attachments)
73+
- [Storing](../../document-extensions/attachments/storing)
74+
- [Deleting](../../document-extensions/attachments/deleting)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Attachments: Loading Attachments
2+
3+
There are a few methods that allow you to download attachments from a database:
4+
5+
**session.advanced().attachments().get** can be used to download an attachment.
6+
**session.advanced().attachments().getNames** can be used to download all attachment names that are attached to a document.
7+
**session.advanced().attachments().getRevision** can be used to download an attachment of a revision document.
8+
**session.advanced().attachments().exists** can be used to determine if an attachment exists on a document.
9+
10+
## Syntax
11+
12+
{CODE:java GetSyntax@DocumentExtensions\Attachments\Attachments.java /}
13+
14+
## Example
15+
16+
{CODE:java GetAttachment@DocumentExtensions\Attachments\Attachments.java /}
17+
18+
## Related Articles
19+
20+
### Attachments
21+
22+
- [What are Attachments](../../document-extensions/attachments/what-are-attachments)
23+
- [Storing](../../document-extensions/attachments/storing)
24+
- [Deleting](../../document-extensions/attachments/deleting)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Attachments: Loading Attachments
2+
3+
There are a few methods that allow you to download attachments from a database:
4+
5+
**session.advanced.attachments.get()** can be used to download an attachment.
6+
**session.advanced.attachments.getNames()** can be used to download all attachment names that are attached to a document.
7+
**session.advanced.attachments.getRevision()** can be used to download an attachment of a revision document.
8+
**session.advanced.attachments.exists()** can be used to determine if an attachment exists on a document.
9+
10+
## Syntax
11+
12+
{CODE:nodejs GetSyntax@DocumentExtensions\Attachments\attachments.js /}
13+
14+
| Parameters | | |
15+
| ------------- | ------------- | ----- |
16+
| **entity** or **documentId** | object or string | instance of the entity or the entity ID |
17+
| **name** | string | attachment name |
18+
| **changeVector** | string | change vector for revision identification |
19+
20+
| Return Value | |
21+
| ------------- | ------------- |
22+
| `Promise<AttachmentStreamResult>` | Promise resolving to a Readable for attachment content |
23+
24+
## Example
25+
26+
{CODE:nodejs GetAttachment@DocumentExtensions\Attachments\attachments.js /}
27+
28+
## Related Articles
29+
30+
### Attachments
31+
32+
- [What are Attachments](../../document-extensions/attachments/what-are-attachments)
33+
- [Storing](../../document-extensions/attachments/storing)
34+
- [Deleting](../../document-extensions/attachments/deleting)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Attachments: Loading Attachments
2+
3+
Several methods allow you to download attachments from a database:
4+
5+
Use `session.advanced.attachments.get` to download an attachment or multiple attachments.
6+
Use `session.advanced.attachments.getNames` to get all the names of a document's attachments.
7+
Use `session.advanced.attachments.getRevision` to download an attachment of a document revision.
8+
Use `session.advanced.attachments.exists` to determine if an attachment exists on a document.
9+
10+
## Syntax
11+
12+
{CODE:php GetSyntax@DocumentExtensions\Attachments\Attachments.php /}
13+
14+
## Example I
15+
16+
{CODE:php GetAttachment@DocumentExtensions\Attachments\Attachments.php /}
17+
18+
## Related Articles
19+
20+
### Attachments
21+
22+
- [What are Attachments](../../document-extensions/attachments/what-are-attachments)
23+
- [Storing](../../document-extensions/attachments/storing)
24+
- [Deleting](../../document-extensions/attachments/deleting)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Attachments: Loading Attachments
2+
3+
Several methods allow you to download attachments from a database:
4+
5+
Use `session.advanced.attachments.get` to download an attachment or multiple attachments.
6+
Use `session.advanced.attachments.get_names` to get all the names of a document's attachments.
7+
Use `session.advanced.attachments.get_revision` to download an attachment of a document revision.
8+
Use `session.advanced.attachments.exists` to determine if an attachment exists on a document.
9+
10+
## Syntax
11+
12+
{CODE:python GetSyntax@DocumentExtensions\Attachments\Attachments.py /}
13+
14+
## Example I
15+
16+
{CODE:python GetAttachment@DocumentExtensions\Attachments\Attachments.py /}
17+
18+
## Related Articles
19+
20+
### Attachments
21+
22+
- [What are Attachments](../../document-extensions/attachments/what-are-attachments)
23+
- [Storing](../../document-extensions/attachments/storing)
24+
- [Deleting](../../document-extensions/attachments/deleting)

0 commit comments

Comments
 (0)