diff --git a/dmoj/settings.py b/dmoj/settings.py index d5cfa38..e136a4d 100644 --- a/dmoj/settings.py +++ b/dmoj/settings.py @@ -485,6 +485,9 @@ META_REMOTE_ADDRESS_KEY = "REMOTE_ADDR" DEFAULT_AUTO_FIELD = "django.db.models.AutoField" +# Chunk upload +CHUNK_UPLOAD_DIR = "/tmp/chunk_upload_tmp" + try: with open(os.path.join(os.path.dirname(__file__), "local_settings.py")) as f: exec(f.read(), globals()) diff --git a/judge/utils/fine_uploader.py b/judge/utils/fine_uploader.py index a9909a7..2a22ccf 100644 --- a/judge/utils/fine_uploader.py +++ b/judge/utils/fine_uploader.py @@ -35,7 +35,7 @@ def save_upload(f, path): # pass callback function to post_upload def handle_upload(f, fileattrs, upload_dir, post_upload=None): - chunks_dir = os.path.join(tempfile.gettempdir(), "chunk_upload_tmp") + chunks_dir = settings.CHUNK_UPLOAD_DIR if not os.path.exists(os.path.dirname(chunks_dir)): os.makedirs(os.path.dirname(chunks_dir)) chunked = False