Aug-28-2019, 12:39 PM
Hi, I am able to upload files to a directory on my server using the following code :
Is this possible?
Thanks for any advice/help
Fioranosnake
for file in file_list: filename = secure_filename(file.filename) file.save(os.path.join(app.config["UPLOAD_FOLDER"], filename)) flash('File(s) successfully uploaded')I am setting UPLOAD_FOLDER in my core.py module :
UPLOAD_FOLDER = 'D:/DataUpload' app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDERWhat I would like to do is take the users email from the form as the directory with DataUpload and if it already exists then upload the files to it otherwise create the directory using the email address and then upload the files to it.
Is this possible?
Thanks for any advice/help
Fioranosnake