diff --git a/beetsplug/web/__init__.py b/beetsplug/web/__init__.py index 290f25b48c..14e338ba6b 100644 --- a/beetsplug/web/__init__.py +++ b/beetsplug/web/__init__.py @@ -217,12 +217,13 @@ def all_items(): @app.route('/item//file') def item_file(item_id): item = g.lib.get_item(item_id) + item_path = util.syspath(item.path) if os.name == 'nt' else util.py3_path(item.path) response = flask.send_file( - util.py3_path(item.path), + item_path, as_attachment=True, attachment_filename=os.path.basename(util.py3_path(item.path)), ) - response.headers['Content-Length'] = os.path.getsize(item.path) + response.headers['Content-Length'] = os.path.getsize(item_path) return response