Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2893cd7

Browse files
authored
Add files via upload
1 parent c861c2a commit 2893cd7

File tree

8 files changed

+33
-0
lines changed

8 files changed

+33
-0
lines changed

python-flask-file-download/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from flask import Flask
2+
3+
app = Flask(__name__)
7.58 KB
Binary file not shown.

python-flask-file-download/info.xlsx

9.7 KB
Binary file not shown.

python-flask-file-download/main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from app import app
2+
from flask import Flask, send_file, render_template
3+
4+
@app.route('/')
5+
def upload_form():
6+
return render_template('download.html')
7+
8+
@app.route('/download')
9+
def download_file():
10+
#path = "html2pdf.pdf"
11+
#path = "info.xlsx"
12+
path = "simple.docx"
13+
#path = "sample.txt"
14+
return send_file(path, as_attachment=True)
15+
16+
if __name__ == "__main__":
17+
app.run()

python-flask-file-download/readme.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You can go through the tutorial https://www.roytuts.com/how-to-download-file-using-python-flask/

python-flask-file-download/sample.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
I would love to try or hear the sample audio your app can produce. I do not want to purchase, because I've purchased so many apps that say they do something and do not deliver.
2+
3+
Can you please add audio samples with text you've converted? I'd love to see the end results.
4+
5+
Thanks!
73.7 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!doctype html>
2+
<title>Python Flask File Download Example</title>
3+
<h2>Download a file</h2>
4+
5+
<p>
6+
<a href="{{ url_for('.download_file') }}">Download</a>
7+
</p>

0 commit comments

Comments
 (0)