Professional Documents
Culture Documents
/**
* Upload by chunks - transfer phase
*
* @param string $endpoint
* @param FacebookTransferChunk $chunk
* @param boolean $allowToThrow
*
* @return FacebookTransferChunk
*
* @throws FacebookResponseException
*/
public function transfer($endpoint, FacebookTransferChunk $chunk, $allowToThrow
= false)
{
$params = [
'upload_phase' => 'transfer',
'upload_session_id' => $chunk->getUploadSessionId(),
'start_offset' => $chunk->getStartOffset(),
'video_file_chunk' => $chunk->getPartialFile(),
];
try {
$response = $this->sendUploadRequest($endpoint, $params);
} catch (FacebookResponseException $e) {
$preException = $e->getPrevious();
if ($allowToThrow || !$preException instanceof
FacebookResumableUploadException) {
throw $e;
}