Skip to content

Commit a91dd7b

Browse files
committed
add download csv as zip example
1 parent 2521df2 commit a91dd7b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

examples/zipped_csv/README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Serving a Zip file of data within a flask app
2+
=============================================================
3+
4+
This application shows how to make your data as a zipped csv file

examples/zipped_csv/example.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from flask import Flask, request, jsonify
2+
from flask.ext import excel
3+
4+
app=Flask(__name__)
5+
6+
@app.route("/download", methods=['GET'])
7+
def download_file():
8+
return excel.make_response_from_array([[1,2], [3, 4]], "csvz")
9+
10+
if __name__ == "__main__":
11+
app.run()

0 commit comments

Comments
 (0)