Commits

Kevin Chan committed 70d7877

Added chmod 0644 to handle_upload_file function; added
DEFAULT_PERMISSIONS.

Comments (0)

Files changed (2)

     
     file_path = os.path.join(path, file.name)
     uploadedfile = default_storage.save(file_path, file)
+    os.chmod(uploadedfile, get_settings_var().get('DEFAULT_PERMISSIONS', DEFAULT_PERMISSIONS))
     return uploadedfile
 
 
 # regex to clean dir names before creation
 FOLDER_REGEX = getattr(settings, "FILEBROWSER_FOLDER_REGEX", r'^[\sa-zA-Z0-9._/-]+$')
 
+# default uploaded file permissions
+DEFAULT_PERMISSIONS = getattr(settings, 'FILEBROWSER_DEFAULT_PERMISSIONS', 0755)
+
 # EXTRA TRANSLATION STRINGS
 # The following strings are not availabe within views or templates
 _('Folder')