phacility/phabricator · error · PhabricatorFileUploadException

UPLOAD_ERR_EXTENSION

UPLOAD_ERR_EXTENSION

Error message

Unable to upload: a PHP extension stopped the upload.

What it means

Represents PHP upload error UPLOAD_ERR_EXTENSION as surfaced by PhabricatorFileUploadException from readUploadedFileData: a PHP extension (commonly the upload progress or an image/AV extension) halted the upload mid-flight. The fault lies in server-side PHP extension configuration, not in Phabricator's own validation.

Solutions

  1. Identify which PHP extension cancelled the upload (check loaded extensions, e.g. suhosin or AV scanners)
  2. Configure or disable the offending extension
  3. Verify the file is not being flagged by server-side scanning
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/applications/files/storage/PhabricatorFile.php:194 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/f8c8c43e29fbff15. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/files/storage/PhabricatorFile.php:194

    return true;
  }

  public function getMonogram() {
    return 'F'.$this->getID();
  }

  public function scrambleSecret() {
    return $this->setSecretKey($this->generateSecretKey());
  }

  public static function readUploadedFileData($spec) {
    if (!$spec) {
      throw new Exception(pht('No file was uploaded!'));
    }

    $err = idx($spec, 'error');
    if ($err) {
      throw new PhabricatorFileUploadException($err);
    }

    $tmp_name = idx($spec, 'tmp_name');

    // NOTE: If we parsed the request body ourselves, the files we wrote will
    // not be registered in the `is_uploaded_file()` list. It's fine to skip
    // this check: it just protects against sloppy code from the long ago era
    // of "register_globals".

    if (ini_get('enable_post_data_reading')) {
      $is_valid = @is_uploaded_file($tmp_name);
      if (!$is_valid) {
        throw new Exception(pht('File is not an uploaded file.'));
      }
    }

    $file_data = Filesystem::readFile($tmp_name);
    $file_size = idx($spec, 'size');

View on GitHub (pinned to 5720a38cfe)