feat(attachment): Ensure temporary directory is created for downloads

This commit is contained in:
Andy
2025-07-30 18:52:36 +00:00
parent 3efac3d474
commit 5d1f2eb458

View File

@@ -62,6 +62,7 @@ class Attachment:
session = session or requests.Session() session = session or requests.Session()
response = session.get(url, stream=True) response = session.get(url, stream=True)
response.raise_for_status() response.raise_for_status()
config.directories.temp.mkdir(parents=True, exist_ok=True)
download_path.parent.mkdir(parents=True, exist_ok=True) download_path.parent.mkdir(parents=True, exist_ok=True)
with open(download_path, "wb") as f: with open(download_path, "wb") as f: