php codeigniter로 이미지를 업로드하는 데 문제가 있습니다. 이미지가 php codeigniter로 업로드됩니다.
이
그것은 간단한 함수이고 난 그냥 내가 선택한 파일 (이미지)의 이름을보고 싶어 내 컨트롤러public function FunctionName()
{
$profile_pic = $this->input->post('profile_pic');
echo $profile_pic;
}
입니다. 나는이 스크립트를 실행하면
이
내보기<form class="" method="post" action="<?=base_url();?>Controller/FunctionName" enctype="multipart/form-data">
<input type="file" name="profile_pic">
<input type="submit" name="submit">
</form>
입니다. 그것은 빈 페이지를 보여줍니다. 내가 선택한 파일의 이름을 가져 오거나 표시 할 수 없습니다. 헬퍼를 자동로드했습니다. 예 :
$autoload['helper'] = array('url', 'file', 'date', 'form');
사용 에코 $ _FILES [ 'profile_pic'] [이름]; – JYoThI
그것은 나에게 오류를 준다 : 메시지 : 정의되지 않은 상수 이름의 사용 - '이름'으로 가정 –
광산 실수 이것을 시도하십시오. echo $ _FILES [ 'profile_pic'];을 사용하십시오. – JYoThI