Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
if ($mime_type !== null) { | if ($mime_type !== null) { | ||||
$params['mime-type'] = 'application/octet-stream'; | $params['mime-type'] = 'application/octet-stream'; | ||||
} | } | ||||
// NOTE: These files have a view policy which prevents normal access. They | // NOTE: These files have a view policy which prevents normal access. They | ||||
// are only accessed through the storage engine. | // are only accessed through the storage engine. | ||||
$chunk_data = PhabricatorFile::newFromFileData( | $chunk_data = PhabricatorFile::newFromFileData( | ||||
$data, | $data, | ||||
$params); | $params, | ||||
$viewer); | |||||
$chunk->setDataFilePHID($chunk_data->getPHID())->save(); | $chunk->setDataFilePHID($chunk_data->getPHID())->save(); | ||||
$needs_update = false; | $needs_update = false; | ||||
$missing = $this->loadAnyMissingChunk($viewer, $file); | $missing = $this->loadAnyMissingChunk($viewer, $file); | ||||
if (!$missing) { | if (!$missing) { | ||||
$file->setIsPartial(0); | $file->setIsPartial(0); | ||||
Show All 16 Lines |