Handling File Uploads With Flask - miguelgrinberg.com

PHOTO EMBED

Tue Sep 06 2022 13:30:25 GMT+0000 (Coordinated Universal Time)

Saved by @Rmin #python #uploadfile #flask

@app.route('/uploads/<filename>')
@login_required
def upload(filename):
    return send_from_directory(os.path.join(
        app.config['UPLOAD_PATH'], current_user.get_id()), filename)
content_copyCOPY

Consuming private uploads

https://blog.miguelgrinberg.com/post/handling-file-uploads-with-flask