Get attachment link from post ID or attachment ID

abdfahim

Active member
#1
Is it possible (if possible, is there any guide) to get the link to the attachment(s) from the post/attachment ID?
 
Last edited:

Mike

XenForo developer
Staff member
#2
The xf_attachment table has the attachment ID as the primary key, if you have that ID. Within that, there are content_type and content_id columns. The content type here would be "post" (and the content ID is the post ID).
 
Top