forked from mirrors/LibreTranslate
remove uuid and fix downloaded filename
This commit is contained in:
parent
c5f47f0917
commit
9e272cb80c
1 changed files with 4 additions and 3 deletions
|
@ -612,7 +612,6 @@ def create_app(args):
|
||||||
"""
|
"""
|
||||||
Download a translated file
|
Download a translated file
|
||||||
"""
|
"""
|
||||||
filename.split('.').pop(0)
|
|
||||||
filepath = os.path.join(get_upload_dir(), filename)
|
filepath = os.path.join(get_upload_dir(), filename)
|
||||||
|
|
||||||
return_data = io.BytesIO()
|
return_data = io.BytesIO()
|
||||||
|
@ -620,9 +619,11 @@ def create_app(args):
|
||||||
return_data.write(fo.read())
|
return_data.write(fo.read())
|
||||||
return_data.seek(0)
|
return_data.seek(0)
|
||||||
|
|
||||||
print(filename)
|
download_filename = filename.split('.')
|
||||||
|
download_filename.pop(0)
|
||||||
|
download_filename = '.'.join(download_filename)
|
||||||
|
|
||||||
return send_file(return_data, attachment_filename=filename)
|
return send_file(return_data, as_attachment=True, attachment_filename=download_filename)
|
||||||
|
|
||||||
@app.route("/detect", methods=["POST"])
|
@app.route("/detect", methods=["POST"])
|
||||||
@access_check
|
@access_check
|
||||||
|
|
Loading…
Reference in a new issue