Location: PHPKode > projects > Network Configuration Store > NCS-3.0.2/wwwroot/Devices/Download.php
<?php

require_once('./CS_Includes.inc.php');

try {
	CS::Check($_GET['revision_id'], CSA_EMPTY|CSA_THROW, 'DeviceDownload with no revision_id');

	$config = new CSConfig($_GET['revision_id']);

	$fileData = $config->GetConfig();
	$fileSize = strlen($fileData);
}
catch (Exception $e) {
	CS::Abort($e);
}

header('Pragma: public');
header('Expires: 0');

header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);

header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename='.$config->GetFileName());
header('Content-Length: '.$fileSize);
header('Content-Transfer-Encoding: binary');

echo $fileData;

?>
Return current item: Network Configuration Store