Skip to content

Commit a7a5460

Browse files
authored
fix(local): create upload subdirectories as public (0755), not private (0700) (#489)
The Local adapter uses Flysystem v3's LocalFilesystemAdapter, which defaults the directory visibility to PRIVATE. PRIVATE maps to 0700, so each daily folder under public/assets/files (e.g. 2026-04-30/) is created without group/other read/execute permissions, and uploaded images cannot be served by the web server even though the file itself is written 0644. Pass a PortableVisibilityConverter with PUBLIC as the default directory visibility so new daily folders are created 0755, matching the v1.x behaviour and the expected 'images served, files protected' posture. Closes #488. Signed-off-by: SAY-5 <say.apm35@gmail.com>
1 parent f4234d1 commit a7a5460

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Adapters/Manager.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
use Illuminate\Support\Str;
3030
use League\Flysystem\AwsS3V3\AwsS3V3Adapter;
3131
use League\Flysystem\Local\LocalFilesystemAdapter;
32+
use League\Flysystem\UnixVisibility\PortableVisibilityConverter;
33+
use League\Flysystem\Visibility;
3234
use Overtrue\Flysystem\Qiniu\QiniuAdapter;
3335
use Qiniu\Http\Client as QiniuClient;
3436

@@ -165,7 +167,10 @@ protected function imgur(Util $util)
165167
protected function local(Util $util)
166168
{
167169
return new Adapters\Local(
168-
new LocalFilesystemAdapter($this->paths->public.'/assets/files'),
170+
new LocalFilesystemAdapter(
171+
$this->paths->public.'/assets/files',
172+
PortableVisibilityConverter::fromArray([], Visibility::PUBLIC)
173+
),
169174
$this->settings,
170175
$this->url,
171176
$this->config

0 commit comments

Comments
 (0)