Skip to content

Commit fdadb93

Browse files
authored
Added temporary file permission customization
1 parent 5e9f91e commit fdadb93

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Types/TemporaryFile.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ public function __construct(
2929
protected string $toFolder,
3030
protected string $toDisk,
3131
protected bool $keepOriginalName,
32+
protected int $permissions = 0664,
3233
) {
3334
$this->tmpPath = tempnam(sys_get_temp_dir(), 'tmp');
3435

3536
if (file_put_contents($this->tmpPath, $content) === false) {
3637
throw UploadedFileWriteException::cannotWriteTemporaryFile($this->tmpPath);
3738
}
39+
40+
chmod($this->tmpPath, $permissions);
3841
}
3942

4043
/**

0 commit comments

Comments
 (0)