mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
15 lines
291 B
Python
15 lines
291 B
Python
import io
|
|
|
|
from flask import Flask, send_file
|
|
|
|
app = Flask(__name__)
|
|
|
|
@app.route('/')
|
|
def index():
|
|
buf = io.BytesIO()
|
|
buf.write(b'hello world')
|
|
buf.seek(0)
|
|
return send_file(buf,
|
|
attachment_filename="testing.txt",
|
|
as_attachment=True)
|