질문 Q #10727
파일 업로드 문제..
김대현 2013-08-12 14:26:04

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) "" }



답변 4
#1 변종원(웅파) 2013-08-12 15:54:00
ci log 나 아파치 로그 확인해보세요. 

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

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

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