Get attachment link from post ID or attachment ID

abdfahim

Well-known member
Is it possible (if possible, is there any guide) to get the link to the attachment(s) from the post/attachment ID?
 
Last edited:
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 Bottom