HI,
here is a code example:
Guid attachmentGuid = ValidationHelper.GetGuid("teaserImaeg", Guid.Empty);
string nodeAlias = ValidationHelper.GetString("NodeAlias", "");
string fileUrl = URLHelper.ResolveUrl(AttachmentManager.GetAttachmentUrl(attachmentGuid, nodeAlias));
The option with nodeAlias="" should work as well. In this case the URL will containg ~/getattachment/<guid>, otherwise the node alias path parts will be included in the attachment url.
Best regards,
Ivana Tomanickova