Skip to content

Commit ea1513d

Browse files
KJLKurtyouchenlee
authored andcommitted
Create an option to perform chmod by @KJLKurt (cherry-pick from v1)
1 parent 904eb08 commit ea1513d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

docs/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
| raster\_mimetypes | array | Array of mime types. Thumbnails will be created only for these mimetypes. |
5959
| create\_folder\_mode | int | Permission setting for folders created by this package. |
6060
| create\_file\_mode | int | Permission setting for files uploaded to this package. |
61+
| should\_change\_file\_mode | boolean | If true, it will attempt to chmod the file after upload |
6162
| valid\_file\_mimetypes | array | Array of mime types. Available since v1.3.0 . |
6263

6364

src/LfmFileRepository.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public function save($file)
4343

4444
File::move($file->getRealPath(), $dest_file_path);
4545

46-
chmod($dest_file_path, config('lfm.create_file_mode', 0644));
46+
if (config('lfm.should_change_file_mode', true)) {
47+
chmod($dest_file_path, config('lfm.create_file_mode', 0644));
48+
}
4749
}
4850
}

src/config/lfm.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@
107107
// permissions to be set on file upload.
108108
'create_file_mode' => 0644,
109109

110+
// If true, it will attempt to chmod the file after upload
111+
'should_change_file_mode' => true,
112+
110113
/*
111114
|--------------------------------------------------------------------------
112115
| Thumbnail

0 commit comments

Comments
 (0)