You are here

public function UploadController::handleUploads in Plupload integration 8

Same name and namespace in other branches
  1. 2.0.x src/UploadController.php \Drupal\plupload\UploadController::handleUploads()

Handles Plupload uploads.

1 string reference to 'UploadController::handleUploads'
plupload.routing.yml in ./plupload.routing.yml
plupload.routing.yml

File

src/UploadController.php, line 80

Class

UploadController
Plupload upload handling route.

Namespace

Drupal\plupload

Code

public function handleUploads() {

  // @todo: Implement file_validate_size();
  try {
    $this
      ->prepareTemporaryUploadDestination();
    $this
      ->handleUpload();
  } catch (UploadException $e) {
    return $e
      ->getErrorResponse();
  }

  // Return JSON-RPC response.
  return new JsonResponse([
    'jsonrpc' => '2.0',
    'result' => NULL,
    'id' => 'id',
  ], 200);
}