Confluence Docs 3.0 : List page- and space-related details for an attachment using the attachment's name This page last changed on Jan 29, 2009 by ggaskell. 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 `<Confluence-Home>/attachments/pageid/attachmentid/attachmentversion` ## Related Unix Commands #### file <Filename> If you wish to check the filetype for attachments in your `<Confluence-Home>/atachments/` folder, run the above Unix command. Eg:
    file ../data/attachments/32775/98305/1
The result is:
    ../data/attachments/32775/98305/1: PNG image data, 1200 x 1000, 8-bit/color RGB, non-interlaced
#### open <Filename> This command will open files from a shell. By default, opens each file using the default application for that file. Eg:
    open ../data/attachments/32775/98305/1 -a /Applications/Preview.app/
The result is: The file is opened in Preview.

Document generated by Confluence on Nov 05, 2009 23:34