Skip to content

Commit

Permalink
Delete temporary uploaded file after response
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Feb 19, 2024
1 parent 76bd972 commit df7582b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Assets/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public function upload(UploadedFile $file)

$this->write($source, $path = $this->uploadPath($file));

app('files')->delete($source);
dispatch(function () {
app('files')->delete($source);
})->afterResponse();

return $path;
}
Expand Down

0 comments on commit df7582b

Please sign in to comment.