Bug #4664 : impossible to download a zip archive of files attached to publications registered under a node that is shared

- fixing technical error on temporary work folder creation
- fixing node access rights around aliases
- refactoring some code