코드 이그니 터 프레임 워크 내에서 업로드 라이브러리를 사용하여 파일 업로드 기능을 일부 생성하고 있으며 파일 업로드 경로가 잘못되었다는 오류 메시지가 계속 표시되는 문제가 있습니다. 여러 번 확인했는데 파일 구조에 문제가 없으며 파일이 확실히 존재합니다. 여기 코드 Igniter 파일 업로드 경로가 잘못되었습니다.
내 모델 업로드 코드 (나는 과정에서 어딘지 확인 죽어 있어요) :class Gallery_model extends CI_Model {
var $gallery_path;
function __construct() {
parent::__construct();
$this->gallery_path = realpath(APPPATH . '../images/profileImages');
//$this->gallery_path = realpath($this->config->base_url() . 'images/profileImages');
}
public function doUpload() {
$config = array(
'allowed_types' => 'jpg|jpeg|png|gif',
'upload_path' => $this->gallery_path
);
$this->load->library('upload', $config);
if($this->upload->do_upload()) {
$data = array('upload_data' => $this->upload->data());
die(print_R($data));
} else {
$error = array('error' => $this->upload->display_errors());
die(print_R($error));
}
}
}
내 이미지 폴더가 응용 프로그램의 외부와 '이미지'라고 폴더를 포함하는 이 파일을 저장하려면 'profileImage'라고 부릅니다. 다음 오류가 발생합니다.
'업로드 경로가 유효하지 않습니다.'
나는 분명히 존재할 때 왜이 경로가 작동하지 않는지 알 수 없다. 누구든지 아이디어가 있습니까? 감사합니다
(APPPATH '이미지/profileImages /'.)' –