phacility/phabricator · error · Exception
Field "data_base64" must be non-empty.
Error message
Field "data_base64" must be non-empty.
What it means
Request-field guard in file.upload execute: the 'data_base64' field is null (absent from the request). The strict null check means the field itself was not provided — an empty string would pass — so the upload cannot proceed without file data.
Solutions
- Include a non-null 'data_base64' field containing base64-encoded file content
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/applications/files/conduit/FileUploadConduitAPIMethod.php:35 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/005de7118bcf53b7.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/files/conduit/FileUploadConduitAPIMethod.php:35
'viewPolicy' => 'optional valid policy string or <phid>',
'canCDN' => 'optional bool',
);
}
protected function defineReturnType() {
return 'nonempty guid';
}
protected function execute(ConduitAPIRequest $request) {
$viewer = $request->getUser();
$name = $request->getValue('name');
$can_cdn = (bool)$request->getValue('canCDN');
$view_policy = $request->getValue('viewPolicy');
$data = $request->getValue('data_base64');
if ($data === null) {
throw new Exception(pht('Field "data_base64" must be non-empty.'));
}
$data = $this->decodeBase64($data);
$params = array(
'authorPHID' => $viewer->getPHID(),
'canCDN' => $can_cdn,
'isExplicitUpload' => true,
);
if ($name !== null) {
$params['name'] = $name;
}
if ($view_policy !== null) {
$params['viewPolicy'] = $view_policy;
}
$file = PhabricatorFile::newFromFileData($data, $params);View on GitHub (pinned to 5720a38cfe)