'{username}', 'apiKey' => '{apiKey}', )); // 2. Obtain an Object Store service object from the client. $objectStoreService = $client->objectStoreService(null, '{region}'); // 3. Get container. $container = $objectStoreService->getContainer('{containerName}'); // 4. Open local file $fileData = fopen('{localFilePath}', 'r'); // 5. Specify any metadata you want your objects to have $metadata = array('{key}' => '{value}'); $metadataHeaders = DataObject::stockHeaders($metadata); // 6. Merge the metadata with any additional HTTP headers you want to set $allHttpHeaders = array('Content-Type' => '{contentType}') + $metadataHeaders; // 7. Upload it! Note that while we call fopen to open the file resource, we do // not call fclose at the end. The file resource is automatically closed inside // the uploadObject call. $container->uploadObject('{remoteObjectName}', $fileData, $allHttpHeaders);