{"record":{"id":"fa820a75270dd1f4","repo":"phacility/phabricator","slug":"upload-err-no-tmp-dir","errorCode":"UPLOAD_ERR_NO_TMP_DIR","errorMessage":"Unable to write file: temporary directory does not exist.","messagePattern":"Unable to write file: temporary directory does not exist\\.","errorType":"exception","errorClass":"PhabricatorFileUploadException","httpStatus":null,"severity":"error","filePath":"src/applications/files/storage/PhabricatorFile.php","lineNumber":194,"sourceCode":"    return true;\n  }\n\n  public function getMonogram() {\n    return 'F'.$this->getID();\n  }\n\n  public function scrambleSecret() {\n    return $this->setSecretKey($this->generateSecretKey());\n  }\n\n  public static function readUploadedFileData($spec) {\n    if (!$spec) {\n      throw new Exception(pht('No file was uploaded!'));\n    }\n\n    $err = idx($spec, 'error');\n    if ($err) {\n      throw new PhabricatorFileUploadException($err);\n    }\n\n    $tmp_name = idx($spec, 'tmp_name');\n\n    // NOTE: If we parsed the request body ourselves, the files we wrote will\n    // not be registered in the `is_uploaded_file()` list. It's fine to skip\n    // this check: it just protects against sloppy code from the long ago era\n    // of \"register_globals\".\n\n    if (ini_get('enable_post_data_reading')) {\n      $is_valid = @is_uploaded_file($tmp_name);\n      if (!$is_valid) {\n        throw new Exception(pht('File is not an uploaded file.'));\n      }\n    }\n\n    $file_data = Filesystem::readFile($tmp_name);\n    $file_size = idx($spec, 'size');","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/storage/PhabricatorFile.php#L176-L212","documentation":"Error \"Unable to write file: temporary directory does not exist.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/files/storage/PhabricatorFile.php:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}