}
    $oResponse->setData(true);
    $oResponse->flushJson();
}
if (Request::getQuery('action') === 'download') {
    $download = Request::getQuery('preview') === 'true' ? '' : 'attachment;';
    $filePath = Request::getQuery('path');
    $fileName = explode('/', $filePath);
    $fileName = end($fileName);
    $tmpFilePath = $oFtp->downloadTemp($filePath);
    if ($fileContent = @file_get_contents($tmpFilePath)) {
        $oResponse->setData($fileContent);
        $oResponse->setHeaders(array('Content-Type' => @mime_content_type($tmpFilePath), 'Content-disposition' => sprintf('%s filename="%s"', $download, $fileName)));
    }
    $oResponse->flush();
}
if (Request::getQuery('action') === 'downloadMultiple') {
    $items = Request::getApiOrQueryParam('items');
    $toFilename = Request::getApiOrQueryParam('toFilename');
    $errors = array();
    $fileContent = is_array($items) ? implode($items, ", \n") : '';
    if ($errors) {
        throw new Exception("Unknown compressing to download: \n\n" . implode(", \n", $errors));
    }
    if ($fileContent) {
        $oResponse->setData($fileContent);
        $oResponse->setHeaders(array('Content-Type' => @mime_content_type($fileContent), 'Content-disposition' => sprintf('attachment; filename="%s"', $toFilename)));
    }
    $oResponse->flush();
}
throw new \Exception('This action is not available in the demo');