내 학교 프로젝트를 구축하는 데 codeigniter를 처음 사용했습니다.Codeigniter 게시가 작동하지 않습니다.
나는 곧장 가자.
form_upload()를 제외하고 POST 요청을받을 수 있습니다.
이 내 샘플 양식입니다 :
<?php
echo form_open('admin/test_upload');
echo form_input(array('name' => 'title'));?><br/><?
echo form_upload(array('name' => 'file'));
echo form_submit(array('name' => 'submit', 'value' => 'submit'));
echo form_close();
?>
이 내 컨트롤러 :
function test_upload(){
$data['header'] = "TEST UPLOAD";
var_dump($_POST) ; //basically, this is function echoes back the post array.
$this->load->view('admin/dashboard_view', $data);
}
이
가array(2) {
["title"]=>
string(3) "asd"
["submit"]=>
string(6) "submit"
}
//The ["file"] is missing.... wHAT!?>
누군가가 나를 도울 수있는 출력은?
그래, 어떻게이 요청을 검색 할 수 있습니까? $ this-> input-> post ('file')를 사용할 수 있습니까? ? –
'$ _FILES [ 'file'] [ 'tmp_name']'을 사용하여 임시 업로드 파일의 경로를 얻은 다음 서버로 복사하거나 다른 작업을 수행 할 수 있습니다. '$ _FILES [ 'file'] [ 'name']'는 업로드 된 파일의 원래 경로를 포함합니다. [PHP.net의 문서] (http://www.php.net/manual/en/features.file-upload.post-method.php)에는 훨씬 더 자세한 정보가 있습니다. – Quantastical