Commit 8a3d2067 authored by comfyanonymous's avatar comfyanonymous
Browse files

Merge branch 'image-content-disposition-filename' of https://github.com/pythongosssss/ComfyUI

parents a8aa623a 3c25f5dc
......@@ -129,12 +129,12 @@ class PromptServer():
return web.Response(status=403)
output_dir = full_output_dir
file = request.rel_url.query["filename"]
file = os.path.basename(file)
file = os.path.join(output_dir, file)
filename = request.rel_url.query["filename"]
filename = os.path.basename(filename)
file = os.path.join(output_dir, filename)
if os.path.isfile(file):
return web.FileResponse(file)
return web.FileResponse(file, headers={"Content-Disposition": f"filename=\"{filename}\""})
return web.Response(status=404)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment