Skip to content

Commit

Permalink
Potential fix for empty image uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkwinkelmann committed May 31, 2022
1 parent 8ebe405 commit 83f9750
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/AvatarUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ public function upload(UploadedFileInterface $file): string

$avatarPath = Str::random() . '.' . $ext;

$this->uploadDir->put('predefined/' . $avatarPath, $file->getStream()->getContents());
$stream = $file->getStream();
$stream->rewind();

$this->uploadDir->put('predefined/' . $avatarPath, $stream->getContents());

return $avatarPath;
}
Expand Down

0 comments on commit 83f9750

Please sign in to comment.