Hi,
I have created an API in the index file in the slim framework.
Something as below ':
$app->get('/getXML', function (Request $request, Response $response) { $file = PROJECT_ROOT . '/library/8.txt'; if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment;filename="'.basename($file).'"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); readfile($file); exit; }
I wanted to create an API that can let me download multiple files in one request.
like hit getMultiFiles, and I am able to download 1.txt, 2.txt and 3.txt.
Could you help me out please?
Thanks,
Reema