Automatically generate links to paste in posts for attachments