Set file permissions for uploaded files.
Merge pull request #1010 from NatTuck/upload-permissions

Set file permissions for uploaded files.