아래 기능을 사용하여 내 이미지 파일을 내 서버 (로컬 호스트)에 업로드하고 있습니다. 괜찮아요 이미지가 업로드되고 있습니다. 하지만 두 개의 이미지 필드가 필요하므로 제출 버튼을 클릭하면 두 이미지를 모두 업로드해야합니다. 여기에 설명 된 기능을 사용했습니다. Codeigniter multiple file upload, 그러나 작동하지 않습니다.codeigniter에서 이미지를 업로드하는 중 사용자 파일이 필요합니까?
나는 오류입니다
A PHP Error was encountered
Severity: Warning
Message: is_uploaded_file() expects parameter 1 to be string, array given
Filename: libraries/Upload.php
Line Number: 161
그럼 내가 이해할 수없는이 오류 메시지가 표시됩니다. 나는 하나의 이미지를 업로드하기 위해 사용하고있는 기능은 나는 또한 내가 내 선택의 입력 필드 이름을 변경할 수 있습니다 부탁 또한
function do_upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'jpeg|png|gif';
$config['max_size'] = '0';
$config['max_width'] = '0';
$config['max_height'] = '0';
$this->load->library('upload', $config);
if (! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
//failed display the errors
}
else
{
//success
}
}
입니다. 즉 나는 항상 <input type="file" name="userfile"/>
을 구현해야합니다. 이름을 바꿀 수 있습니까? 변경하려고 시도하고 메시지가 나타납니다 파일을 선택하지 않았으므로 변경할 수 없습니다.
질문에 게시 한 오류 메시지가 계속 나타납니다. – prakashchhetri
실수가 수정되었습니다. –
하나의 이미지 만 업로드하고 있습니다. – prakashchhetri