Image failing with "Error! Unable to load the attachment. Please check if the file exists" depending on the Browser used
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
When viewing a page, an image fails to be presented with the error "Error! Unable to load the attachment. Please check if the file exists." depending on the Browser used, and not consistent for all users.
Environment
Confluence Cloud
Diagnosis
The page is using the Legacy Editor;
The space was migrated from Confluence On-Prem Environment;
The image is nested inside a third-party macro, for instance: Table Filter macro > Table > Image;
Moving the image out of the macro works fine and the image is presented;
HAR file analysis shows:
Browser failing is redirecting the download request to a login:
1
Location: /wiki/login.action?os_destination=%2Fdownload%2Fattachments%2F10488018%2Fimage-2023-7-14_10-42-52.png%3Fapi%3Dv2
Browser working is executing the download using the session token:
1
Location: https://api.media.atlassian.com/file/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/binary?token=eyJhbxxxxxxxxx&client=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxbe&name=image-2023-7-14_10-42-52.png
Cause
Third-party macros in Confluence Cloud are isolated within an iframe, which is a HTML document embedded inside another HTML document. The iFrame macro allows you to embed a webpage inside a Confluence page.
This isolation within an iframe provides a level of security as it prevents the third-party macros from directly accessing or manipulating the parent document or the data contained in it.
Due to this isolation, the browse should be configured to allow third-party cookies, thus the download request issued by the iframe can use the token session.
Solution
On your computer, open Chrome
.
At the top right, click More
Settings
.
Click Privacy and security
Third-party cookies.
Tip: If you are part of the Tracking Protection test group, follow the “Tracking Protection” instructions instead.
Select Allow third-party cookies.
In the Safari app
on your Mac, choose Safari > Settings, then click Advanced.
Deselect “Block all cookies.”
In the Menu bar at the top of the screen, click Firefox and then select Preferences or Settings, depending on your Operational System version;
Select the Privacy & Security panel;
Under Enhanced Tracking Protection, select the Custom radio button;
Check Cookies and use the drop-down menu to select the types of cookies you wish to block;
Select to block "Cross-site tracking cookies" or "cookies from unvisited websites".
In the Edge window, select More (...) > Settings > View advanced settings.
Scroll down to Cookies, and select Don't block cookies.
Was this helpful?