1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Many older attachments now 404 but see them in file store

Discussion in 'XenForo Questions and Support' started by Mouth, Oct 9, 2016.

  1. Mouth

    Mouth Well-Known Member

    After a few post reports, it seems my site has a fairly consistent issue with attachments in some older posts (12+ mths) where clicking on the attachment link gives a 404 error, but I can see the file within the attachments\ file store.

    For example, I have a link such as;
    Code:
    https://site.com/attachments/39394/
    ...  which is [ATTACH=full]39394[/ATTACH] when editing the post
    
    ... which gives a 404 error.

    When I look at the file store/structure, the file appears to be there though;
    Code:
    data/attachments/39/39394-5e5cfd5313d26c88531cec0668ea805e.jpg
    internal_data/attachments/39/39394-5e5cfd5313d26c88531cec0668ea805e.data
    
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    In BB code and URLs we reference the attachment_id from the xf_attachment table.

    On the file system, the ID used is the data_id from the xf_attachment_data table.

    You need to look up the attachment_id (39394) in the xf_attachment table and that will tell you what the data_id is.
     
  3. Mouth

    Mouth Well-Known Member

    Thanks.
    Code:
    mysql> select * from xf_attachment where attachment_id = 39394;
    Empty set (0.00 sec)
    
    ... suggests that something removed it from the xf_attachment table at some stage?
     

Share This Page