3 namespace Drupal\Core\StreamWrapper;
8 * Defines a Drupal temporary (temporary://) stream wrapper class.
10 * Provides support for storing temporarily accessible files with the Drupal
13 class TemporaryStream extends LocalStream {
18 public static function getType() {
19 return StreamWrapperInterface::LOCAL_HIDDEN;
25 public function getName() {
26 return t('Temporary files');
32 public function getDescription() {
33 return t('Temporary local files for upload and previews.');
39 public function getDirectoryPath() {
40 return file_directory_temp();
46 public function getExternalUrl() {
47 $path = str_replace('\\', '/', $this->getTarget());
48 return Url::fromRoute('system.temporary', [], ['absolute' => TRUE, 'query' => ['file' => $path]])->toString();