added download/upload attachment functionality to document controller