Replies: 1 comment
-
Just return stream like Flask. ...
from io import BytesIO
from flask import send_file
@app.get("/")
def index():
stream = get_excel_stream()
return send_file(BytesIO(stream), download_name="filename") # 如果需要作为附件下载,则指定as_attachment参数为True |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
apiflask how to return a excel file stream or how to return Binary as response
@greyli
Beta Was this translation helpful? Give feedback.
All reactions