Scalr\Service\Aws\S3\DataType\BucketData::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 ( string $objectName, string | SplFileInfo $contentFile, array $requestHeaders = null ) : ClientResponseInterface
$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 ClientResponseInterface Returns response on success or throws an exception
    public function addObject($objectName, $contentFile, array $requestHeaders = null)
    {
        $this->throwExceptionIfNotInitialized();
        return $this->getS3()->bucket->addObject($this->bucketName, $objectName, $contentFile, $requestHeaders);
    }