You are here

private function BackupDatabaseRemoteAdapter::download in Backup Database 8

Expose the export for download.

1 call to BackupDatabaseRemoteAdapter::download()
BackupDatabaseRemoteAdapter::export in src/Adapter/BackupDatabaseRemoteAdapter.php
Export method.

File

src/Adapter/BackupDatabaseRemoteAdapter.php, line 57
Contains \Drupal\backup_db\Adapter\BackupDatabaseRemoteAdapter

Class

BackupDatabaseRemoteAdapter
BackupDatabaseRemoteAdapter class.

Namespace

Drupal\backup_db\Adapter

Code

private function download($path, $config) {
  $response = new BinaryFileResponse($path);
  $response
    ->trustXSendfileTypeHeader();
  $response->headers
    ->set('Content-Type', $config['type']);
  $response
    ->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $config['name']);
  $response
    ->prepare(\Symfony\Component\HttpFoundation\Request::createFromGlobals());
  $response
    ->send();
}