src/Module/Firewall/Controller/GlobalURL/GetGlobalURLFileController.php line 12
<?phpnamespace App\Module\Firewall\Controller\GlobalURL;use App\Module\Firewall\Entity\GlobalURL;use App\Module\Symfony\Controller\SageController;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;#[Route("/getAPIlink")]class GetGlobalURLFileController extends SageController{#[Route("/{globalURL}")]public function __invoke(GlobalURL $globalURL){// Generate response$response = new Response();$content = "; Created by Sage Link monitor API on " .date('d-m-Y-Hi'). " \r\n";$content .="; Hello there Boy Cracky! \r\n" ;$content .=$globalURL->getIpAddressList();// // Create the TEMP File// $file = fopen('php://memory', 'rw+');//// // Need to add CR LF to end of line (Windows only ??)// // Wont matter anyway, just be a blank line//// //Headings// fputs( $file , "; Created by Sage Link monitor API on " .date('d-m-Y-Hi'). " \r\n");// fputs( $file , "; Hello there Boy Cracky! \r\n" );// // The list of IPs// fputs($file, $globalURL->getIpAddressList());//// rewind($file);// $content = stream_get_contents($file);// Set headers$response->headers->set('Cache-Control', 'private');$response->headers->set('Content-type', 'text/plain' );$response->headers->set('Content-Disposition', 'attachment; filename="drop.txt";');$response->headers->set('Content-length', strlen($content));$response->setcontent( $content );return $response;}}