How to find specific user profile pictures from the Confluence attachments directory
Purpose
You may want to locate specific user profile pictures stored in your Confluence home directory. However, the Attachments Hierarchy places all user profile pictures in various directories within the <confluence-home>/attachments/ver003/nonspaced> directory, making them difficult to find as the folders are not labeled with the parent page's content id.
Please note that the way attachments are stored has changed over various versions of Confluence, so this may not work for your instance. This solution only applies to Confluence versions where attachments are stored in the Home Directory and not the database.
Solution
Run the following query replacing <USERNAME> with the username of the profile you are searching for.
Select user_mapping.lower_username , content.contentid from user_mapping LEFT JOIN content ON user_mapping.user_key = content.creator where content.title='user-avatar' and user_mapping.lower_username='<USERNAME>';
It will return a table like:
lower_username content id admin 1900545 If you receive a table with a lower_username but no content id that means no custom profile picture was uploaded for that user
lower_username content id admin - Then browse to <confluence-home>/attachments/ver003/nonspaced where you can search for the specific folder matching the content id you have identified from the query.