mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 14:31:13 +02:00
1 parent
c10e692ca2
commit
b36c5f25d2
2 files changed
+9
-4
No files matched your search
@@ -71,8 +71,11 @@ class UploadHandler:
|
||||
try:
|
||||
os.makedirs(destination_dir, exist_ok=True)
|
||||
with open(destination_path, "wb+") as f:
|
||||
chunk = data["file"].file.read()
|
||||
f.write(chunk)
|
||||
while True:
|
||||
chunk = data["file"].file.read(512)
|
||||
if not chunk:
|
||||
break
|
||||
f.write(chunk)
|
||||
st = os.stat(destination_path)
|
||||
os.chmod(destination_path, st.st_mode | stat.S_IXUSR)
|
||||
except OSError as e:
|
||||
|
||||
Reference in new issue
Block a user