Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,17 +1470,17 @@ def download_attachments_from_page(self, page_id, path=None, start=0, limit=50,
file_name = attachment["title"] or attachment["id"] # Use attachment ID if title is unavailable
download_link = self.url + attachment["_links"]["download"]
# Fetch the file content
response = self.get(str(download_link))
response = self.get(str(download_link), not_json_response=True)

if to_memory:
# Store in BytesIO object
file_obj = io.BytesIO(response.content)
file_obj = io.BytesIO(response)
downloaded_files[file_name] = file_obj
else:
# Save file to disk
file_path = os.path.join(path, file_name)
with open(file_path, "wb") as file:
file.write(response.content)
file.write(response)

# Return results based on storage mode
if to_memory:
Expand Down