You are here

private static function FlmngrServer::reqFilePreview in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

1 call to FlmngrServer::reqFilePreview()
FlmngrServer::flmngrRequest in vendor/edsdk/flmngr-server-php/src/FlmngrServer.php

File

vendor/edsdk/flmngr-server-php/src/FlmngrServer.php, line 264

Class

FlmngrServer

Namespace

EdSDK\FlmngrServer

Code

private static function reqFilePreview($config) {
  $filePath = $_GET['f'];
  $width = $_GET['width'];
  $height = $_GET['height'];
  try {
    $fileSystem = new FMDiskFileSystem($config);
    list($mimeType, $f) = $fileSystem
      ->getImagePreview($filePath, $width, $height);
    header('Content-Type:' . $mimeType);
    fpassthru($f);
    die;
  } catch (MessageException $e) {
    return new Response($e
      ->getFailMessage(), NULL);
  }
}