mirror of
https://github.com/alvierahman90/uploadr.git
synced 2026-01-14 07:04:00 +00:00
Automatically create directories if non existant
This commit is contained in:
@@ -11,6 +11,12 @@ from werkzeug.utils import secure_filename
|
||||
app = Flask(__name__)
|
||||
app.config['SECRET_KEY'] = os.urandom(24)
|
||||
|
||||
if not os.path.isdir(config.uploads):
|
||||
os.makedirs(config.uploads)
|
||||
|
||||
if not os.path.isdir(config.qrcodes):
|
||||
os.makedirs(config.qrcodes)
|
||||
|
||||
@app.route("/")
|
||||
@app.route('/upload', methods=['GET','POST'])
|
||||
def upload_file():
|
||||
|
||||
Reference in New Issue
Block a user