Skip to content

Commit

Permalink
Fix passing absolute path to storage
Browse files Browse the repository at this point in the history
  • Loading branch information
howdu committed Sep 5, 2024
1 parent 36c95a4 commit 21eb218
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Files/TemporaryFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 21eb218

Please sign in to comment.