Fix filename of book download (was pre- and suffixed with single quotes)

This commit is contained in:
Jan Broer 2015-08-06 04:10:47 +02:00
parent 6e26c0818a
commit c92de6e539

View File

@ -289,7 +289,7 @@ def get_download_link(book_id, format):
data = db.session.query(db.Data).filter(db.Data.book == book.id).filter(db.Data.format == format.upper()).first() data = db.session.query(db.Data).filter(db.Data.book == book.id).filter(db.Data.format == format.upper()).first()
helper.update_download(book_id, int(current_user.id)) helper.update_download(book_id, int(current_user.id))
response = make_response(send_from_directory(os.path.join(config.DB_ROOT, book.path), data.name + "." +format)) response = make_response(send_from_directory(os.path.join(config.DB_ROOT, book.path), data.name + "." +format))
response.headers["Content-Disposition"] = "attachment; filename='%s.%s'" % (data.name, format) response.headers["Content-Disposition"] = "attachment; filename=%s.%s" % (data.name, format)
return response return response
@app.route('/login', methods = ['GET', 'POST']) @app.route('/login', methods = ['GET', 'POST'])