mirror of
https://github.com/bryangerlach/rdgen.git
synced 2025-12-02 18:13:16 +00:00
remove the need for ftp server
This commit is contained in:
@@ -338,4 +338,15 @@ def save_png(file, uuid, domain):
|
||||
imageJson['uuid'] = uuid
|
||||
imageJson['file'] = quote(file.name)
|
||||
#return "%s/%s" % (domain, file_save_path)
|
||||
return json.dumps(imageJson)
|
||||
return json.dumps(imageJson)
|
||||
|
||||
def save_custom_client(request):
|
||||
file = request.FILES['file']
|
||||
myuuid = request.POST.get('uuid')
|
||||
file_save_path = "exe/%s/%s" % (myuuid, file.name)
|
||||
Path("exe/%s" % myuuid).mkdir(parents=True, exist_ok=True)
|
||||
with open(file_save_path, "wb+") as f:
|
||||
for chunk in file.chunks():
|
||||
f.write(chunk)
|
||||
|
||||
return HttpResponse("File saved successfully!")
|
||||
Reference in New Issue
Block a user