Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #36 from datagovuk/unicode-in-filenames
Browse files Browse the repository at this point in the history
Remove unicode characters from download filenames
  • Loading branch information
rossjones committed Jan 25, 2016
2 parents 8c419a6 + 5b949b0 commit a658997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contractfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def download(notice_id, file_id):
download_file = NoticeDocument.query.filter_by(file_id=file_id).first_or_404()

directory = os.path.abspath(os.path.join(app.instance_path, 'documents', notice_id))
filename = download_file.filename
filename = download_file.filename.encode('latin1', 'ignore')
mimetype = download_file.mimetype

return send_from_directory(directory,
Expand Down

0 comments on commit a658997

Please sign in to comment.