Skip to content
Advertisement

Can i have two different sets of app configurations?

I have made a flask server REST API that does an upload to a specific folder. The upload must comply to a specific file extension, and must be in a specific folder.

So i made these two app.configs:

JavaScript

However, i want to make a new route, for a new upload of a specific file extension to another folder.

So can i have two sets of app.config['UPLOAD_EXTENSIONS'] and app.config['UPLOAD_PATH']?

One set will be for extension1 in folder1 and the other set for extension2 in folder2.

Advertisement

Answer

Try using the extension Flask-Uploads .

Or, proceeding from the file format, form a subdirectory in your UPLOAD_PATH.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement