Change to the attribute download method

- Permissions weren't checked correctly when downloading attachments
Merge branch 'hotfix-2.1.24'