+ 5

Is it possible for flask upload to upload a file from any directory?

Right now I have a code that have the app.config['UPLOAD_FOLDER'] have a static value. Whatever is the path that is declared to the app.config['UPLOAD_FOLDER'] is the only path of the file that can be uploaded.

19th Aug 2019, 2:40 AM
ariamossar
ariamossar - avatar
3 Antworten
+ 1
What I did now was I save the file first in the folder that I declared in the app.config['UPLOAD_FOLDER'] before accessing it.
20th Aug 2019, 6:20 AM
ariamossar
ariamossar - avatar
0
yea, of course you can do that with sys.dir()
19th Aug 2019, 2:19 PM
Wert Werter
Wert Werter - avatar
0
sys library has these functions that can help you to return address or remove some file.
19th Aug 2019, 2:22 PM
Wert Werter
Wert Werter - avatar