diff --git a/src/Files/TemporaryFile.php b/src/Files/TemporaryFile.php index fbd7ebd9..9098365a 100644 --- a/src/Files/TemporaryFile.php +++ b/src/Files/TemporaryFile.php @@ -53,11 +53,13 @@ public function sync(): TemporaryFile public function copyFrom($filePath, string $disk = null): TemporaryFile { if ($filePath instanceof UploadedFile) { - $filePath = $filePath->getRealPath(); + $realPath = $filePath->getRealPath(); + } else { + $realPath = realpath($filePath); } - if ($disk === null && realpath($filePath) !== false) { - $readStream = fopen($filePath, 'rb'); + if ($realPath !== false) { + $readStream = fopen($realPath, 'rb'); } else { $diskInstance = app('filesystem')->disk($disk);