Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php
<?php | <?php | ||||
final class FileUploadChunkConduitAPIMethod | final class FileUploadChunkConduitAPIMethod | ||||
extends FileConduitAPIMethod { | extends FileConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'file.uploadchunk'; | return 'file.uploadchunk'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return pht('Upload a chunk of file data to the server.'); | return pht('Upload a chunk of file data to the server.'); | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'filePHID' => 'phid', | 'filePHID' => 'phid', | ||||
'byteStart' => 'int', | 'byteStart' => 'int', | ||||
'data' => 'string', | 'data' => 'string', | ||||
'dataEncoding' => 'string', | 'dataEncoding' => 'string', | ||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'void'; | return 'void'; | ||||
} | } | ||||
public function defineErrorTypes() { | |||||
return array(); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
$file_phid = $request->getValue('filePHID'); | $file_phid = $request->getValue('filePHID'); | ||||
$file = $this->loadFileByPHID($viewer, $file_phid); | $file = $this->loadFileByPHID($viewer, $file_phid); | ||||
$start = $request->getValue('byteStart'); | $start = $request->getValue('byteStart'); | ||||
Show All 39 Lines |