Skip to content

Commit 612139e

Browse files
fix eSign example 7
1 parent 906af9a commit 612139e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app/eSignature/examples/eg007_envelope_get_doc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def worker(args):
4141
document_id = args["document_id"]
4242

4343
# Call the envelope get method to get the path of the temp file with the documents
44-
(temp_file_path, status, headers) = envelope_api.get_document_with_http_info(
44+
(document_bytes, status, headers) = envelope_api.get_document_with_http_info(
4545
account_id=args["account_id"],
4646
document_id=document_id,
4747
envelope_id=args["envelope_id"]
@@ -76,4 +76,4 @@ def worker(args):
7676
else:
7777
mimetype = "application/octet-stream"
7878

79-
return {"mimetype": mimetype, "doc_name": doc_name, "data": temp_file_path}
79+
return {"mimetype": mimetype, "doc_name": doc_name, "data": document_bytes}

app/eSignature/views/eg007_envelope_get_doc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""007: Get an envelope"s document"""
22

3+
from io import BytesIO
34
from os import path
45

56
from docusign_esign.client.api_exception import ApiException
@@ -39,10 +40,10 @@ def get_envelope_doc():
3940

4041
# 3. Download envelope document from the temp file path
4142
return send_file(
42-
results["data"],
43+
BytesIO(results["data"]),
4344
mimetype=results["mimetype"],
4445
as_attachment=True,
45-
attachment_filename=results["doc_name"]
46+
download_name=results["doc_name"]
4647
)
4748
else:
4849
return render_template(

0 commit comments

Comments
 (0)