"Unknown Attachment" displaying for Anonymous users instead of image.
Asked by Phil Gochenour:

I'm having a very strange error with two images attached to a topic. The entire space containing the topic was published from a private document development space to a public space that can be accessed by anonymous users. I've done this twice in the past with no problems.

The error is this: if I'm a logged in (internal user) I can see the two images (.png files) that are attached to the page. If I'm logged out (anonymous user) I see "Unknown Attachment" where the images should appear. If I hover over those Unknown Attachment inserts, I see the filenames for the attachments (xxxxxxxx.png), and if I click on them, I see the messagae "The requested content cannot be loaded. Please try again later."

I tried removing the images and re-uploading them, and still got the same error. I checked all the permissions on the space and topic, and they are identical to the other public versions. These are the only two attachments in the entire space with this issue. It seems like it must be a permissions problem of some sort, but I'm at loss for how to diagnose it.


Answers:
author: Jeremy Largman
body: This is usually a permissions problem. The attachment is usually on a page that has page restrictions, then copied over to a blog post or different page. If you make sure the original attachment is accessible or that it's copied over and reattached it should solve the problem in most cases.


author: Davin Studer
body: I've had issues like this before. What I did to fix it was I copied the attachment to my local machine and then deleted the one on the wiki page. Then I re-uploaded the attachment with the exact same name. After that it started working.

comments: author: Dane Vosler
body: Yeap. I was trying to avoid that, but it may be the only way. The only other way is to provide 'Anonymous' access to the other space I'm pulling the picture from so it cascades to the space that's not working. The latter is what I'm doing now because I have about 40 images on this one page and am not ready to do this on a picture by picture basis haha.

Thanks again David.


author: Davin Studer
body: If you have the WebDav plugin installed you can interact with Confluence as if it were a filesystem of folders and files. So, you could navigate to the page and just delete the images and recopy them to the page and it would take you all of 30 seconds to do.


author: R Donato
body: What version of Confluence are you using? We're using 5.4.2 and having the same issue.


author: Davin Studer
body: I'm on 5.4.4.


author: R Donato
body: Thanks for the info.


author: Dane Vosler
body: I am having the same problem. I do not want to have to copy and paste all of my images back to Paint or [Paint.net](http://Paint.net)(if I can avoid it).


author: Sow Behl
body: We are having the exact same issue. We have 4.3.3. The only problem is that when we delete the image and then try again then we are able to view it. Please help us find a resolution.


author: William Zanchet [Atlassian]
body: Hey Phil,  

Did you upload those .pngs files in the same space that has this specific page? Or you're getting it from other space? Can you double check if the the space has anonymous permission by going through the Space Tools?

Can you confirm, if when you put the name of the attachment in the search box with an anonymous user, you can see the attachment at least?

You might want to flush the index, and do a reindex just to see if this is an index problem.  

* Flush the Cache *- Confluence Admin \> Cache Statistics \> Flush All*
* Content indexing - *Confluence Admin \> Search index*   

Cheers,  

WZ

comments: author: Phil Gochenour
body: The space with the problem attachments is a direct copy of another space, and the images are attached to the page itself, rather than being referenced from another space. The problem space does have anonymous view permissions set, and, as I said, these are the only images in the space that are not displaying correctly.

If I search for the image as an anonymous user I am able to find it in the search results as an attachment on the page, and when I click on the image name, it displays correctly.


author: Phil Gochenour
body: I tried the flush and re-indexing, and still have the same problem.


author: karthikys
body: We are facing the same issue in all our spaces. Can you please provide a workaround.

Thanks,


author: Marian Vidra
body: We've got the same problem with all PNG images and also with WebP images. None of them apart from JPEGs are shown for external users


Tags: attachment