src/Handlers/S3.php
/**
     * Upload a file
     *
     * @param string $source Full path to the file, including the filename
     */
Upload a file
@param string $source Full path to the file, including the filename
Upload a file @param string $source Full path to the file including the filename
public function persistFile(string $source, string $destinyDir, string $destinyFile) : Image
    {
        $destinyFile = $this->sanitizeFilename($destinyFile);
        $fullPath    = $this->bucketName . '/' . $destinyDir . '/' . $destinyFile;
        $destinyPath = $destinyDir . '/' . $destinyFile;
        $objectInfo  = [
            'Bucket'     => $this->bucketName,
            'Key'        => $destinyPath,
            'SourceFile' => $source,
            'ACL'        => 'public-read',
        ];
        $this->s3Client->putObject($objectInfo);
        return new Image($fullPath, $destinyFile);
    }
public function persistFile ( string $ source , string $ destinyDir , string $ destinyFile ) : Image { $ destinyFile = $ this -> sanitizeFilename ( $ destinyFile ) ; $ fullPath = $ this -> bucketName . '/' . $ destinyDir . '/' . $ destinyFile ; $ destinyPath = $ destinyDir . '/' . $ destinyFile ; $ objectInfo = [ 'Bucket' => $ this -> bucketName , 'Key' => $ destinyPath , 'SourceFile' => $ source , 'ACL' => 'public-read' , ] ; $ this -> s3Client -> putObject ( $ objectInfo ) ; return new Image ( $ fullPath , $ destinyFile ) ; }
Upload a file
 @param string $source Full path to the file, including the filename
Upload a file @param string $source Full path to the file including the filename