$request->RequesterCredentials->eBayAuthToken = $config['sandbox']['userToken'];
/**
 * Give the picture a name.
 */
$request->PictureName = 'Example';
/**
 * Attach the picture that we want to upload.
 * Specifying the mime type is optional. Defaults to application/octet-stream if none is provided.
 */
$request->attachment(file_get_contents(__DIR__ . '/picture.jpg'), 'image/jpeg');
/**
 * Send the request to the UploadSiteHostedPictures service operation.
 *
 * For more information about calling a service operation, see:
 * http://devbay.net/sdk/guides/getting-started/#service-operation
 */
$response = $service->uploadSiteHostedPictures($request);
/**
 * Output the result of calling the service operation.
 *
 * For more information about working with the service response object, see:
 * http://devbay.net/sdk/guides/getting-started/#response-object
 */
if (isset($response->Errors)) {
    foreach ($response->Errors as $error) {
        printf("%s: %s\n%s\n\n", $error->SeverityCode === Enums\SeverityCodeType::C_ERROR ? 'Error' : 'Warning', $error->ShortMessage, $error->LongMessage);
    }
}
if ($response->Ack !== 'Failure') {
    printf("The picture [%s] can be found at %s\n", $response->SiteHostedPictureDetails->PictureName, $response->SiteHostedPictureDetails->FullURL);
}