wp_attach_url
Returns the AttachURL parameter (no trailing slash).
Source code:
set url [ad_parameter "AttachURL" wp "/wp/attach/"] regsub {/$} $url "" url return $url