내 경로가 :Laravel 4 500을 받고 항상 작동하지 uploadifile (내부 서버 오류)
Route::get('/file', array(
'as' => 'files',
'uses' => '[email protected]'
));
Route::post('/uploadfile', array(
'as' => 'uploadfile',
'uses' => '[email protected]'
));
지금 난 내/파일 경로에 uploadifive 설정 및 보내는 POST 요청이에/UploadFile로
UploadFile로에 대한 코드는 여기에 있습니다 :
$file = Input::file('file_upload');
$destinationPath = 'files/CDN/'.str_random(8);
echo $filename = $file->getClientOriginalName();
$extension =$file->getClientOriginalExtension();
$uploadSuccess = Input::file('file')->move($destinationPath, $filename);
하지만 항상 내가 무엇입니까 500 (내부 서버 오류)
나는 CHMOD가 0777 하고 난/UploadFile로에서 위의 코드를 제거하고 성공을 반환
echo 200;
을 배치 할 때 내가 같이 우측 경로에 연결하고 내 디렉토리를 확인했습니다.
블레이드 폼 태그도 추가하려고했지만 uploadifive는 실제로 폼 요소에 전혀 의존하지 않습니다. 그것은 AJAX로 게시됩니다.
처럼 당신이'$ 파일 -을 사용한다고 생각> 모 ve()'마지막 줄에 – lukasgeiter
$ file-> move()가 코드 대신 작동 할 수있는 이유는 파일에 액세스하려는 두 개의 다른 필드 이름 ('file_upload'및 'file '(처음과 마지막 줄을보십시오). 첫 줄을 양식에서 지정하는 것으로 변경하고 $ file-> move ($ destinationPath, $ filename); 마지막 줄에. – Laravelian
안녕하세요, 나는 차이점이없는 $ 파일로 바꾸려고했습니다. 그것도 여전히 동일한 결과를 보여줍니다 : 콘솔'http : // scrumy.co.uk/file' –