오디오 파일 (유형 mp3
, acc
, wav
)을 업로드하고 싶습니다. cakephp 2.4.1 stable
과 php5 stable
을 사용하고 있습니다. 업로드 된 파일이 mp3, acc 또는 wav 형식의 오디오 파일인지 확인하려면 mime_content_type
, finfo_file
을 시도했습니다. 그러나 나는 얻을이cakephp2.4에서 오디오 업로드
내 view.ctp 코드 permited된다
`error mime_content_type(059.piya basanti re... [piya basanti][2000].mp3): failed to open stream: No such file or directory [APP/Controller/AdminController.php, line 86]`
:
<?= $this->Form->create('Homepage',array('type'=>'file'));
echo $this->Form->input('audio_1',array('type'=>'file'));
echo $this->Form->submit('Submit');
echo $this->Form->end(); ?>
내 컨트롤러 코드
public function saveaudio() {
if($this->request->is('post')) {
$this->loadModel('Homepage');
//this is line 86// $file = mime_content_type($this->request->data['Homepage']['audio_1']['name']);
pr($file);exit;
}
및
- 나는 파일의 유형을 확인할 수 있습니다 방법 : 여기 내 데이터
Array ( [Homepage] => Array ( [audio_1] => Array ( [name] => 059.piya basanti re... [piya basanti][2000].mp3 [type] => [tmp_name] => [error] => 1 [size] => 0 ) ) )
내 질문은 무엇입니까? 먼저 MIME 형식을 확인한 다음 저장하려고합니다.
- 업로드 된 파일에 tmp_name이 표시되지 않는 이유는 무엇입니까?
- 왜 mime_content_type에 오류가 발생합니까?
누구나 설명 할 수 있습니까? 그것은 나에게 도움이 될 것입니다