You are here

protected function UploadController::prepareTemporaryUploadDestination in Plupload integration 2.0.x

Same name and namespace in other branches
  1. 8 src/UploadController.php \Drupal\plupload\UploadController::prepareTemporaryUploadDestination()

Prepares temporary destination folder for uploaded files.

Throws

\Drupal\plupload\UploadException

1 call to UploadController::prepareTemporaryUploadDestination()
UploadController::handleUploads in src/UploadController.php
Handles Plupload uploads.

File

src/UploadController.php, line 106

Class

UploadController
Plupload upload handling route.

Namespace

Drupal\plupload

Code

protected function prepareTemporaryUploadDestination() {
  $writable = $this->fileSystem
    ->prepareDirectory($this->temporaryUploadLocation, FileSystemInterface::CREATE_DIRECTORY);
  if (!$writable) {
    throw new UploadException(UploadException::DESTINATION_FOLDER_ERROR);
  }

  // Try to make sure this is private via htaccess.
  $this->htaccessWriter
    ->write($this->temporaryUploadLocation, TRUE);
}