Hello
I have a laravel project, and I'm using Laravel media library package. By default, Laravel's laravel-medialibrary package stores files with the default permissions set by the underlying file system, which is typically 0700 for directories and 0600 for files. I'm trying to change the directories permissions by using this listener
The problem is, the directories permissions still 0700.
Where is the problem?
I have a laravel project, and I'm using Laravel media library package. By default, Laravel's laravel-medialibrary package stores files with the default permissions set by the underlying file system, which is typically 0700 for directories and 0600 for files. I'm trying to change the directories permissions by using this listener
public function handle(MediaHasBeenAdded $event)
{
$media = $event->media;
// Get the path of the directory where the media and its conversions are stored
$directoryPath = dirname($media->getPath());
// Set the desired permissions for the directories
$permissions = 0755; // Change this value to the desired permissions (e.g., 0755 for read/write/execute for owner and read/execute for others)
// Change the permissions recursively for the directory and its subdirectories
File::chmod($directoryPath, $permissions, true);
}
The problem is, the directories permissions still 0700.
Where is the problem?