function DrupalPrivateStreamWrapper::getExternalUrl

Overrides getExternalUrl().

Return the HTML URI of a private file.

Overrides DrupalStreamWrapperInterface::getExternalUrl

File

includes/stream_wrappers.inc, line 980

Class

DrupalPrivateStreamWrapper
Drupal private (private://) stream wrapper class.

Code

function getExternalUrl() {
    $path = str_replace('\\', '/', $this->getTarget());
    return url('system/files/' . $path, array(
        'absolute' => TRUE,
    ));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.