Changed the way to get the path to an attachment file