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

Mouth

Well-known member
#1
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
 

Chris D

XenForo developer
Staff member
#2
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.
 

Mouth

Well-known member
#3
You need to look up the attachment_id (39394) in the xf_attachment table and that will tell you what the data_id is.
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?
 
Top