Skip to content

Commit

Permalink
version 13132
Browse files Browse the repository at this point in the history
  • Loading branch information
gachouchani1999 committed Sep 19, 2021
1 parent fb59134 commit ad6c25d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions flaskr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


app = Flask(__name__, instance_relative_config=True)
global f

@app.route('/', methods=['GET', 'POST'])
def upload_file():
return render_template('upload.html')
Expand All @@ -17,7 +17,10 @@ def upload_file():
@app.route('/uploader', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
global file_name
f = request.files['file']
file_name = f.filename
file_name = file_name.replace(" ","_")
theme = request.form['theme']
f.filename = f.filename.replace(" ","_")
f.save(secure_filename(f.filename))
Expand All @@ -29,7 +32,8 @@ def index():

@app.route('/download')
def download():
filename_new = f.filename[:f.filename.find('.')]

filename_new = file_name[:file_name.find('.')]
path = '../'+filename_new + '.pptx'
return send_file(path, as_attachment=True)

Expand Down

0 comments on commit ad6c25d

Please sign in to comment.