Folder and files upload with Flask Folder and files upload with Flask flask flask

Folder and files upload with Flask


file = request.files['file']

change it to

file = request.files['file[]']


the issue here is that flask's app.config isn't relative to itself, it's absolute. so when you put:

UPLOAD_FOLDER = './uploads' 

flask doesn't find this directory and returns a 500 error.if you changed it to:

UPLOAD_FOLDER = '/tmp'  

and then uploaded your file and navigated to the /tmp/ directory you would see it.

you will need to edit your path to the proper directory for the file to be uploaded properly.