Commit 437b7f22 authored by root's avatar root
Browse files

Added catalog route

parent 93e5ab4c
......@@ -110,5 +110,23 @@ $app->group('/data', function() use ($app) {
})->setName('rdf');
});
$app->get('/catalog.gz', function ($request, $response, $args) {
$file = '../catalog.gz';
$fh = fopen($file, 'rb');
$stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body
return $response->withHeader('Content-Type', 'application/force-download')
->withHeader('Content-Type', 'application/octet-stream')
->withHeader('Content-Type', 'application/download')
->withHeader('Content-Description', 'File Transfer')
->withHeader('Content-Transfer-Encoding', 'binary')
->withHeader('Content-Disposition', 'attachment; filename="' . basename($file) . '"')
->withHeader('Expires', '0')
->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
->withHeader('Pragma', 'public')
->withBody($stream); // all stream contents will be sent to the response
})->setName('catalog');
$app->run();
?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment