Skip to content

Commit

Permalink
Change filePath to real path if it's an upload (SpartnerNL#4132)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacdew2 authored Jun 3, 2024
1 parent 6d9d791 commit dedf198
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Files/TemporaryFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ public function sync(): TemporaryFile
public function copyFrom($filePath, string $disk = null): TemporaryFile
{
if ($filePath instanceof UploadedFile) {
$readStream = fopen($filePath->getRealPath(), 'rb');
} elseif ($disk === null && realpath($filePath) !== false) {
$filePath = $filePath->getRealPath();
}

if ($disk === null && realpath($filePath) !== false) {
$readStream = fopen($filePath, 'rb');
} else {
$diskInstance = app('filesystem')->disk($disk);
Expand Down

0 comments on commit dedf198

Please # to comment.