fix getAttachment if is it file