mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-09-10 11:35:40 +00:00
@@ -363,10 +363,17 @@ class UserManager():
|
|||||||
if not overwrite and os.path.exists(path):
|
if not overwrite and os.path.exists(path):
|
||||||
return web.Response(status=409, text="File already exists")
|
return web.Response(status=409, text="File already exists")
|
||||||
|
|
||||||
|
try:
|
||||||
body = await request.read()
|
body = await request.read()
|
||||||
|
|
||||||
with open(path, "wb") as f:
|
with open(path, "wb") as f:
|
||||||
f.write(body)
|
f.write(body)
|
||||||
|
except OSError as e:
|
||||||
|
logging.warning(f"Error saving file '{path}': {e}")
|
||||||
|
return web.Response(
|
||||||
|
status=400,
|
||||||
|
reason="Invalid filename. Please avoid special characters like :\\/*?\"<>|"
|
||||||
|
)
|
||||||
|
|
||||||
user_path = self.get_request_user_filepath(request, None)
|
user_path = self.get_request_user_filepath(request, None)
|
||||||
if full_info:
|
if full_info:
|
||||||
|
Reference in New Issue
Block a user