XF 1.5 How to locate an attachment with the attachment ID?

Ludachris

Well-known member
I have a reported thread where the attachments are showing up as hyperlinked text like this: View Attachment 104607

The bbcode used in the post is
Code:
[ATTACH=full]104607[/ATTACH]

My question is, how do I search for that attachment in the system to get the actual URL for the attachment to fix the post manually?
 
Once located you will then need to get the data_id which is more than likely a different number.
Wrong. In many cases attachment id and data id will be the same.
In fact I checked a couple of our installs and quite a few of them have 0 attachments where they are different and those DBs that do have such records have way more where they are identical.

internal_data/attachments/{first three numbers of the data_id}/{data_id}-{hash}.data
That is just wrong, as wrong as your statement that internal_data/attachments should be accessible by clients (that should never ever be the case!).

As already explained in https://xenforo.com/community/threa...nt-with-the-attachment-id.177735/post-1410348:
The directory is floor($dataId / 1000) and nothing else, see \XF\Entity\Attachment::_getAbstractedDataPath()
 
Last edited:
Back
Top Bottom