Permissions on file uploads

I’ve just installed Omeka on a virtual host and because my account’s umask is set to 077 all files uploaded and converted by Image Magick have permissions for the user onl, therefore are not published to the web. Our server guys are suggesting I add something into the bootstrap file which sets the umask as 022 for the session? Either that or write a php script to chmod permssions in the ‘files’ directories to 644 and create a cron job to run the script every 5 mins or so?

My question is is there a better way to do this? Is it possible to chmod the files after upload and where can I find the code to do this?



Omeka pretty much just assumes that the files it creates will be server readable, as that’s almost always the case, whether because of the default umask or the fact that on most servers the server user is the user PHP executes as, so it owns all the created files anyway.

You could alter the Storage class to chmod files after moving them to their destination (the file is application/libraries/Omeka/Storage/Adapter/Filesystem.php and the method is store). It might be simpler to, as suggested, add a umask call to the bootstrap file, or otherwise change your default umask.

Cool, thanks John I just wanted clarification ‘from the horses mouth’ so to speak. I’ve changed the mask in the bootstrap file and that works. So all good :thumbsup: