Skip to content

Commit fc14948

Browse files
author
Michal Mitter
committed
fix cut and download
1 parent b28436a commit fc14948

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/views/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def download_static(path=''):
4747
if os.path.isfile(full_path):
4848
as_attachment = request.args.get('dl', '0') == '1'
4949
# http://stackoverflow.com/questions/24612366/flask-deleting-uploads-after-they-have-been-downloaded
50-
return send_from_directory(directory='download', filename=path, as_attachment=as_attachment)
50+
return send_from_directory(directory='download', path=path, as_attachment=as_attachment)
5151
elif os.path.isdir(full_path):
5252
lst = sorted(
5353
[{
@@ -88,8 +88,8 @@ def cut():
8888
except Exception as e:
8989
flash(e)
9090
return render_template('cut.html', cut_form=cut_form, form1=form1, form2=form2)
91-
return send_from_directory(directory='download/cuts', filename='demo-out.dm_84', as_attachment=True,
92-
attachment_filename='demo-out.dm_84')
91+
return send_from_directory(directory='download/cuts', path='demo-out.dm_84', as_attachment=True,
92+
download_name='demo-out.dm_84')
9393
else:
9494
return render_template('cut.html', cut_form=cut_form, form1=form1, form2=form2)
9595

0 commit comments

Comments
 (0)