getTarget()); return Url::fromRoute('system.private_file_download', ['filepath' => $path], ['absolute' => TRUE, 'path_processing' => FALSE])->toString(); } /** * Returns the base path for private://. * * Note that this static method is used by \Drupal\system\Form\FileSystemForm * so you should alter that form or substitute a different form if you change * the class providing the stream_wrapper.private service. * * @return string|null * The base path for private://. NULL means the private directory is not * set. */ public static function basePath() { return Settings::get('file_private_path'); } }