diff --git a/rdgenerator/views.py b/rdgenerator/views.py index e405314..d5a6b39 100644 --- a/rdgenerator/views.py +++ b/rdgenerator/views.py @@ -334,4 +334,14 @@ def save_png(file, uuid, domain): imageJson['uuid'] = uuid imageJson['file'] = file.name #return "%s/%s" % (domain, file_save_path) - return json.dumps(imageJson) \ No newline at end of file + return json.dumps(imageJson) + +def save_custom_client(request): + file = request.FILES['file'] + file_save_path = "clients/custom/%s" % file.name + Path("clients/custom").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!") \ No newline at end of file