Forums

Creating new folders using Flask

Hi, I've searched the forums and not found an answer yet but if I'm repeating a question then please direct me to it accordingly!

I'm creating a webapp where users will be able to generate audio files and I want to be able to create new folders specifically for each user e.g. in static files. To give the following structure: user1 (folder) - audio file 1 - audio file 2 user2 (folder) etc etc etc

The audio files save fine but if I try to use mkdir(path) and then set the file path e.g. /home/user/project/static the code runs without error but I get no folder creation. Is it possible to do this or is there a better way?

Thanks Dave

The most likely cause is that the folder is being created, but it's just not being created where you think it is. See https://help.pythonanywhere.com/pages/NoSuchFileOrDirectory/

Haha ok. If there is no reason why it shouldn't create using mkdir then I'll try again and double check my code. Thanks