Skip to content

Recursive mkdir #18

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
from functools import wraps
from glob import glob
from mimetypes import guess_type
from os import path, mkdir, remove
from os import path, makedirs, remove
from urllib.parse import quote
from urllib.request import pathname2url
from sh import convert
@@ -202,7 +202,7 @@ def resolve_file():
return path.join(relpath, scaled_name)

if settings.STORAGE_TYPE != 'digitalocean_spaces' and not path.exists(basepath):
mkdir(basepath)
makedirs(basepath)

orig_dir = path.join(settings.BASE_DIR, get_rel_path(request.query.coll, thumb_p=False))
orig_path = path.join(orig_dir, storename)
@@ -373,7 +373,7 @@ def fileupload():

elif settings.STORAGE_TYPE == 'local':
if not path.exists(basepath):
mkdir(basepath)
makedirs(basepath)

upload.save(pathname, overwrite=True)