public function DownloadController::downloadCompressedContent in Default Content Deploy 8
Return binary archive file for download.
Return value
\Symfony\Component\HttpFoundation\BinaryFileResponse
1 string reference to 'DownloadController::downloadCompressedContent'
File
- src/
Controller/ DownloadController.php, line 58
Class
- DownloadController
- Returns responses for config module routes.
Namespace
Drupal\default_content_deploy\ControllerCode
public function downloadCompressedContent() {
$this->deployManager
->compressContent();
$path = $this->fileSystem
->getTempDirectory() . '/dcd/content.tar.gz';
$headers = [
'Content-Type' => 'application/tar+gzip',
'Content-Description' => 'File Download',
'Content-Disposition' => 'attachment; filename=content.tar.gz',
];
return new BinaryFileResponse($path, 200, $headers);
}