mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-07 15:24:27 +01:00
Fix file downloads in Windows (#1336)
* Fixes an issue where files could not be downloaded when running on Windows * Closes #1334
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import posixpath
|
||||
import string
|
||||
from shutil import copyfileobj
|
||||
|
||||
@@ -54,7 +55,7 @@ class FilesystemUploader(BaseUploader):
|
||||
|
||||
filename = secure_filename(filename)
|
||||
md5hash = hexencode(os.urandom(16))
|
||||
file_path = os.path.join(md5hash, filename)
|
||||
file_path = posixpath.join(md5hash, filename)
|
||||
|
||||
return self.store(file_obj, file_path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user