CI 묻고 답하기

제목 파일 업로드 문제..
글쓴이 김대현 작성시각 2013/08/12 14:26:04
댓글 : 4 추천 : 0 스크랩 : 0 조회수 : 12639   RSS

public function setUpload()

{

$config['upload_path'] = '/upload';

$config['encrypt_name'] = 'TRUE';

$this -> load -> library('upload', $config);

if($this -> upload -> do_upload())

{

echo $this -> upload -> display_errors('<p>','</p>');

}

else

{

var_dump($this->upload->data());

}

}


페이지는 정상적으로 받아온거같은데 해당 경로에 정상적으로 저장이 되지 않습니다.


 array(14) { ["file_name"]=> string(0) "" ["file_type"]=> string(0) "" ["file_path"]=> string(8) "/upload/" ["full_path"]=> string(8) "/upload/" ["raw_name"]=> string(0) "" ["orig_name"]=> string(0) "" ["client_name"]=> string(0) "" ["file_ext"]=> string(0) "" ["file_size"]=> string(0) "" ["is_image"]=> bool(false) ["image_width"]=> string(0) "" ["image_height"]=> string(0) "" ["image_type"]=> string(0) "" ["image_size_str"]=> string(0) "" }



 다음글 post값 저장하기가 안되는데요.. ㅠㅠ (2)
 이전글 pagination에서 post 값 넘겨받기 (4)

댓글

변종원(웅파) / 2013/08/12 15:54:00 / 추천 0
ci log 나 아파치 로그 확인해보세요. 

설정한 /upload 디렉토리는 application과 같은 레벨에 존재해야 합니다.

파일 업로드관련 질문 하실때는 서버가 윈도우인지 리눅스인지도 글에 올려줘야 합니다.
리눅스일 경우엔 퍼미션 문제도 있습니다.

일단 로그 보세요. 로그에 답이 있습니다.
김대현 / 2013/08/12 16:15:04 / 추천 0
 같은 레벨에 존재합니다...윈도우7 서버를 사용중이고요..으핳
수야디벨 / 2013/08/12 17:37:04 / 추천 0
 form 은 당연히 multipart 이고요?
criuce / 2013/08/12 18:40:16 / 추천 0
do_upload 하실때 from 안의 input file의 name을 적어주셔야 해요.