jeffwright13 / apg_flask

Flask wrapper around the [audio program generator](https://github.com/jeffwright13/audio_program_generator) module
0 stars 3 forks source link

Replace "attachment_filename" with "download_name" when passing back result file #22

Closed jeffwright13 closed 3 years ago

jeffwright13 commented 3 years ago

According to https://werkzeug.palletsprojects.com/en/2.0.x/utils/#werkzeug.utils.send_file, download_name replaces Flask’s attachment_filename parameter in v2.0. Thus, in views.py, change

attachment_filename=str(Path(req_phrase_file_obj.filename))

to

download_name=str(Path(req_phrase_file_obj.filename))

jeffwright13 commented 3 years ago

SHould be just a drop in:

download_name (Optional[str]) – The default name browsers will use when saving the file. Defaults to the passed file name.

jeffwright13 commented 3 years ago

ez