One minute
Sending String as Files

If you need send string as file to the client you can do it as follows:
public function sendIcs()
{
$icsString = $this->Calendars->generateIcs();
$response = $this->response;
// Inject string content into response body
$response = $response->withStringBody($icsString);
$response = $response->withType('ics');
// Optionally force file download
$response = $response->withDownload('filename_for_download.ics');
// Return response object to prevent controller from trying to render
// a view.
return $response;
}
In this example you can see how can you send string as iCal file.
78 Words
2021-09-20 12:55 +0000 (Last updated: 2022-05-15 14:35 +0000)
67a1173 @ 2022-05-15
Cover image source: https://wall.alphacoders.com/big.php?i=1172050