List Page and Space Details that Contain an Attachment via the Attachments Name
Occasionally, the indexing task will report some attachments that failed to be indexed correctly. If you wish to list the page and space-related information for these problematic attachments, (of which you only know their title from the logs) please query your database with the following SQL statement:
select s.spacekey, s.spacename, a.title, a.pageid, a.attachmentid, '(confluence-home)/attachments/' + a.pageid + '/' + a.attachmentid + '/' + a.attversion as filepath from attachments a join content c on a.pageid = c.contentid join spaces s on c.spaceid = s.spaceid where a.title like '<Name of Attachment>'
Please substitute the attachment name in the above query depending upon your requirement.
The filepath column will list all attachments in the directory structure format similar to the way that they are stored in Confluence, such as
Related Linux Commands
If you wish to check the filetype for attachments in your
<Confluence-Home>/atachments/ folder, run the above Linux command.
The result is:
../data/attachments/32775/98305/1: PNG image data, 1200 x 1000, 8-bit/color RGB, non-interlaced
This command will open files from a shell. By default, opens each file using the default application for that file.
open ../data/attachments/32775/98305/1 -a /Applications/Preview.app/
The result is:
The file is opened in Preview.