src/Api/Community.php
private function uploadImage(string $purpose, string $imageData) : string
    {
        $parameters = [
            [
                'name' => 'purpose',
                'contents' => $purpose,
            ],
            [
                'name' => 'file',
                'filename' => 'dummy_file_name',
                'contents' => $imageData,
                'headers' => [
                    'Content-Type' => 'image/jpeg'
                ]
            ],
            [
                'name' => 'mimeType',
                'contents' => 'image/jpeg',
            ]
        ];

        $response = $this->postMultiPart(sprintf(self::SATCHEL_ENDPOINT, $this->id()), $parameters);

        return $response->url;
    }
private function uploadImage(string $purpose, string $imageData) : string
    {
        $parameters = [
            [
                'name' => 'purpose',
                'contents' => $purpose,
            ],
            [
                'name' => 'file',
                'filename' => 'dummy_file_name',
                'contents' => $imageData,
                'headers' => [
                    'Content-Type' => 'image/jpeg'
                ]
            ],
            [
                'name' => 'mimeType',
                'contents' => 'image/jpeg',
            ]
        ];

        $response = $this->postMultiPart(sprintf(self::SATCHEL_ENDPOINT, $this->id()), $parameters);

        return $response->url;
    }
private function uploadImage ( string $ purpose , string $ imageData ) : string { $ parameters = [ [ 'name' => 'purpose' , 'contents' => $ purpose , ] , [ 'name' => 'file' , 'filename' => 'dummy_file_name' , 'contents' => $ imageData , 'headers' => [ 'Content-Type' => 'image/jpeg' ] ] , [ 'name' => 'mimeType' , 'contents' => 'image/jpeg' , ] ] ; $ response = $ this -> postMultiPart ( sprintf ( self :: SATCHEL_ENDPOINT , $ this -> id ( ) ) , $ parameters ) ; return $ response -> url ; }
Uploads an image to Sony's CDN and returns the URL.

Sony requires all images (profile images, community images, etc) to be set with this CDN URL.

@param string $purpose
@return string
Uploads an image to Sony s CDN and returns the URL .