나는 레이아웃 파일에서 다음을 가지고있다;cakePHP 강제 다운로드 ical
<?php
$Filename = "TheEvent.vcs";
header("Content-Type: application/force-download");
header("Content-Disposition: inline; filename=$Filename");
echo $content_for_layout;
?>
이제 컨트롤러에서이 레이아웃을 정의했으며 내 필자의 텍스트 파일을 볼 수있게되었습니다. 유일한 문제는 다운로드가 클라이언트에서 강제되지 않는다는 것입니다. 내가 CakePHP는 2.0
http://labs.iamkoa.net/2007/09/07/create-downloadable-ical-events-via-cake/
감사
애쉬
Perfect. 귀하의 회신에 감사드립니다. – AshHimself
그 이유는 모르겠지만,'$ this-> response-> download ($ filename); 동안'Method download does not exist'를 보여주었습니다. (잘 됐네요. (http://api.cakephp.org/2.0/) 클래스 -CakeResponse.html). 'request'는'response'로 대체되었습니다. –
@ TheSexiestManinJamaica 당신 말이 맞았습니다. – mark