Improve the attachments store file position, add the root path handling