phacility/phabricator · error · Exception

You must save a file before you can generate a view URI.

Error message

You must save a file before you can generate a view URI.

What it means

Error "You must save a file before you can generate a view URI." thrown in phacility/phabricator.

Source

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

    $format = $this->newStorageFormat();

    $iterator = $engine->getRawFileDataIterator(
      $this,
      $begin,
      $end,
      $format);

    return $iterator;
  }

  public function getURI() {
    return $this->getInfoURI();
  }

  public function getViewURI() {
    if (!$this->getPHID()) {
      throw new Exception(
        pht('You must save a file before you can generate a view URI.'));
    }

    return $this->getCDNURI('data');
  }

  public function getCDNURI($request_kind) {
    if (($request_kind !== 'data') &&
        ($request_kind !== 'download')) {
      throw new Exception(
        pht(
          'Unknown file content request kind "%s".',
          $request_kind));
    }

    $name = self::normalizeFileName($this->getName());
    $name = phutil_escape_uri($name);

View on GitHub (pinned to 5720a38cfe)

When it happens

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