mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 17:03:59 +00:00
Laravel Vapor - Fix path to upload documents to S3 bucket with dynamic path
This commit is contained in:
@@ -99,15 +99,17 @@ class ConvertsBase64ToFile
|
||||
*/
|
||||
private function generateFile(FileObject $file, string $suffix = '') {
|
||||
|
||||
// $filePath = $this->path.'/'.$file->getFileName().$suffix.'.'.$file->getExtension();
|
||||
|
||||
// Storage::disk('documents')->put($filePath, $file->getDecodedData());
|
||||
|
||||
// return $filePath;
|
||||
|
||||
$filePath = 'localhost/'.$file->getFileName().$suffix.'.'.$file->getExtension();
|
||||
Storage::put($filePath, $file->getDecodedData(), 's3');
|
||||
return $filePath;
|
||||
$filesystemDriver = Storage::getDefaultDriver();
|
||||
if($filesystemDriver == 's3'){
|
||||
$filePath = $this->path.'/'.$file->getFileName().$suffix.'.'.$file->getExtension();
|
||||
Storage::put($filePath, $file->getDecodedData(), 's3');
|
||||
return $filePath;
|
||||
}
|
||||
else{
|
||||
$filePath = $this->path.'/'.$file->getFileName().$suffix.'.'.$file->getExtension();
|
||||
Storage::disk('documents')->put($filePath, $file->getDecodedData());
|
||||
return $filePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user