Skip to content

Commit dedf198

Browse files
authored
Change filePath to real path if it's an upload (#4132)
1 parent 6d9d791 commit dedf198

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Files/TemporaryFile.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ public function sync(): TemporaryFile
5353
public function copyFrom($filePath, string $disk = null): TemporaryFile
5454
{
5555
if ($filePath instanceof UploadedFile) {
56-
$readStream = fopen($filePath->getRealPath(), 'rb');
57-
} elseif ($disk === null && realpath($filePath) !== false) {
56+
$filePath = $filePath->getRealPath();
57+
}
58+
59+
if ($disk === null && realpath($filePath) !== false) {
5860
$readStream = fopen($filePath, 'rb');
5961
} else {
6062
$diskInstance = app('filesystem')->disk($disk);

0 commit comments

Comments
 (0)