Skip to content Skip to sidebar Skip to footer

Folder And Files Upload With Flask

I can upload a File with flask by following Uploading Files: A
tag is marked with enctype=multipart/form-data and an is placed in that form. T

Solution 1:

file = request.files['file']

change it to

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

Solution 2:

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.

Post a Comment for "Folder And Files Upload With Flask"