mirror of https://github.com/JohnHammond/CTFd.git
Fix file downloads in Windows (#1336)
* Fixes an issue where files could not be downloaded when running on Windows * Closes #1334in-house-export-serialization
parent
24c3520685
commit
fa434c4bdd
|
@ -1,4 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
import posixpath
|
||||||
import string
|
import string
|
||||||
from shutil import copyfileobj
|
from shutil import copyfileobj
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ class FilesystemUploader(BaseUploader):
|
||||||
|
|
||||||
filename = secure_filename(filename)
|
filename = secure_filename(filename)
|
||||||
md5hash = hexencode(os.urandom(16))
|
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)
|
return self.store(file_obj, file_path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue