mirror of
https://github.com/retspen/webvirtcloud
synced 2026-03-21 01:54:50 +00:00
Compare commits
No commits in common. "53240548a22cec66b0143669b51bf64ac1d0817b" and "973cf9ab978dfe31380ffb47850276e92da03e7d" have entirely different histories.
53240548a2
...
973cf9ab97
1 changed files with 6 additions and 8 deletions
|
|
@ -91,16 +91,14 @@ def storage(request, compute_id, pool):
|
|||
"""
|
||||
|
||||
def handle_uploaded_file(path, f_name):
|
||||
target = os.path.normpath(os.path.join(path, str(f_name)))
|
||||
target = os.path.normpath(os.path.join(path, f_name))
|
||||
if not target.startswith(path):
|
||||
raise Exception(_("Security Issues with file uploading"))
|
||||
raise Exception("Security Issues with file uploading")
|
||||
|
||||
try:
|
||||
with open(target, "wb+") as f:
|
||||
for chunk in f_name.chunks():
|
||||
f.write(chunk)
|
||||
except FileNotFoundError:
|
||||
messages.error(request, _("File not found. Check the path variable and filename"))
|
||||
destination = open(target, "wb+")
|
||||
for chunk in f_name.chunks():
|
||||
destination.write(chunk)
|
||||
destination.close()
|
||||
|
||||
compute = get_object_or_404(Compute, pk=compute_id)
|
||||
meta_prealloc = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue