2014-09-30 4 views
0
public function getDownload($name){ 
    $file = storage_path().'/cv/'.$name; //error here 
    $headers = array(
     'Content-Description'  => 'File Transfer', 
     'Content-Type'    => 'application/pdf', 
    ); 
    return Response::download($file, $headers); 
} 

모든 변수를 하나의 변수로 연결하기 만하면됩니다. 모든 매개 변수는 문자열입니다. 다음은 두 variavaies storage_path() 및 $ name 중 하나의 var_dump()입니다.문자열 연결 - preg_match()는 주어진 문자열 배열을 기대합니다.

enter image description here

+1

어디서든지 오류가 발생합니다. 어쩌면 '$ file'이 아닌'$ headers'에 대해 불평 할 수도 있습니다. – DerVO

+0

사실 @DerVO입니다. 타이. 응답 반환 :: 다운로드 ($ 파일, null, $ 헤더); – IRONLORD

답변

0

당신이 요청 공장의 다운로드 방법을 살펴한다면 당신은 당신이 매개 변수를 누락 찾을 수 있습니다.

public function download($file, $name = null, array $headers = array(), $disposition = 'attachment');