Use get_attached_file() to build URLs for attachments.

See e159b