| 제목 | 윈도우 xampp 에 파일업로드 질문입니다. | ||||
|---|---|---|---|---|---|
| 글쓴이 | 초보™ | 작성시각 | 2016/08/10 16:17:14 | ||
|
|
|||||
|
로컬 개발 환경이고요 지금 xmpp 에서 프로그램 개발 테스트 중입니다. CI 이용해서 파일 올리려고 하는데.. DB에 저장은 되는데
해당 폴더에 가면 파일이 저장이 안되네요 .. 코드는 아래와 같습니다.
$this->form_validation->set_rules('category', '카테고리', 'trim');
$this->form_validation->set_rules('title', '제목', 'trim|required|max_length[255]');
$this->form_validation->set_rules('contents', '내용', 'trim|required');
if ($this->form_validation->run() ==TRUE) {
$file_config = array(
'upload_path'=>'inquire_file/',
'encrypt_name'=>TRUE,
'max_size'=>'2048'
);
$this->load->library('upload', $file_config);
if (!$this->upload->do_upload())
{
$data['error']=$this->upload->display_errors();
$this->load->view('inquire/add',$data);
}
$upload_data = $this->upload->data();
$datas = array(
'category'=>$this->input->post('category',TRUE),
'title'=>$this->input->post('title',TRUE),
'contents'=>$this->input->post('contents',TRUE),
'userid'=>$this->session->userdata("id"),
'file_path'=>$upload_data['file_path'],
'file_name'=>$upload_data['file_name'],
'original_name'=>$upload_data['orig_name'],
'detail_info'=>$upload_data['file_size']
);
$result = $this->inquire_model->add($datas);
if ($result!=FALSE)
{
alert('새로운 글이 등록되었습니다.',$this->config->item('base').'/inquire/lists');
exit;
}
폴더 권한은 everyone 을 모든 권한을 줬습니다. (보안설정) 에서요. 왜 파일이 안올라 갈까요 ㅜㅜ;;; 아파치 설정을 해줘야 하나요?
이렇게 DB에는 저장이 되어있습니다.
OS는 윈도우 10 입니다 ㅜㅜ |
|||||
| 다음글 | Pagination url (2) | ||||
| 이전글 | HMVC로 개발중인데 Form_validation에서 ... (1) | ||||
|
변종원(웅파)
/
2016/08/10 16:49:44 /
추천
0
echo $this->upload->display_errors(); 해서 에러 내용 보세요.
|
|
초보™
/
2016/08/10 16:52:54 /
추천
0
@변종원(웅파) 님 You have not specified any allowed file types. The filetype you are attempting to upload is not allowed. 찍어 봤더니 이렇게 나오네요.. allowed_type을 꼭 설정해 줘야 하나요? |