Skip to content

Commit 7c243c8

Browse files
hculeaMOmarMiraj
andauthored
Add example on reading a file field (#159)
* Add example on reading a file field * Update example/example.py Co-authored-by: Mohammed Omar Miraj <[email protected]> --------- Co-authored-by: Mohammed Omar Miraj <[email protected]>
1 parent ea747bd commit 7c243c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

example/example.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ async def create_attach_and_delete_file_field_item(client: Client):
347347
created_item = await client.items.create(to_create)
348348
# [developer-docs.sdk.python.create-item-with-file-field]-end
349349

350+
# [developer-docs.sdk.python.read-file-field]-start
351+
# Read the file field from an item
352+
content = await client.items.files.read(
353+
created_item.vault_id, created_item.id, created_item.files[0]
354+
)
355+
# [developer-docs.sdk.python.read-file-field]-end
356+
print(content.decode())
357+
350358
# [developer-docs.sdk.python.attach-file-field-item]-start
351359
# Attach a file field to the item
352360
attached_item = await client.items.files.attach(

0 commit comments

Comments
 (0)