Scalr\Service\Aws\S3\Handler\BucketHandler::addObject PHP Method

addObject() public method

This implementation of the PUT operation adds an object to a bucket.You must have WRITE permissions on a bucket to add an object to it.
public addObject ( BucketData | string $bucketName, string $objectName, string | SplFileInfo $contentFile, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$objectName string An object name.
$contentFile string | SplFileInfo File content of file that should be uploaded. If you provide a path to the file you should pass SplFileInfo object.
$requestHeaders array optional Request headers
return Scalr\Service\Aws\Client\ClientResponseInterface Returns response on success or throws an exception
    public function addObject($bucketName, $objectName, $contentFile, array $requestHeaders = null)
    {
        if ($bucketName instanceof BucketData) {
            $bucketName = $bucketName->bucketName;
        }
        return $this->getS3()->getApiHandler()->addObject($bucketName, $objectName, $contentFile, $requestHeaders);
    }