Skip to content

Commit

Permalink
Merge pull request #22 from kaptk2/master
Browse files Browse the repository at this point in the history
Prevent Collisions
  • Loading branch information
andreia authored Jul 30, 2023
2 parents 3c536cb + c081ea3 commit 4154d0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Http/Controllers/UppyS3MultipartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ public function createMultipartUpload(Request $request)
{
$type = $request->input('type');
$filenameRequest = $request->input('filename');
$fileName = pathinfo($filenameRequest, PATHINFO_FILENAME);
$fileExtension = pathinfo($filenameRequest, PATHINFO_EXTENSION);
$folder = config('uppy-s3-multipart-upload.s3.bucket.folder') ? config('uppy-s3-multipart-upload.s3.bucket.folder').'/' : '';
$key = $folder.Str::of($fileName.'_'.microtime())->slug('_').'.'.$fileExtension;
$key = $folder.Str::ulid().'.'.$fileExtension;

try {
$result = $this->client->createMultipartUpload([
Expand Down

0 comments on commit 4154d0a

Please sign in to comment.