2023-01-10 18:12:55 +00:00
|
|
|
from flask import Blueprint, render_template, current_app, send_from_directory
|
2023-01-10 14:40:43 +00:00
|
|
|
from werkzeug.utils import secure_filename
|
2023-01-10 18:12:55 +00:00
|
|
|
import os
|
2023-01-10 14:40:43 +00:00
|
|
|
|
2023-01-10 18:12:55 +00:00
|
|
|
blueprint = Blueprint('viewsbp', __name__, url_prefix='/')
|
2023-01-10 14:40:43 +00:00
|
|
|
|
|
|
|
|
2023-01-10 18:12:55 +00:00
|
|
|
@blueprint.route('/uploads/<quality>/<file>')
|
|
|
|
def uploads(quality, file):
|
|
|
|
dir = os.path.join(current_app.config['UPLOAD_FOLDER'], secure_filename(quality))
|
|
|
|
file = secure_filename(file)
|
2023-01-10 14:40:43 +00:00
|
|
|
|
2023-01-10 18:12:55 +00:00
|
|
|
return send_from_directory(dir, file, as_attachment=True)
|