| 제목 | file upload 시 chrome 에서는 되고 ie9 에서 안됩니다 ㅠ | ||
|---|---|---|---|
| 글쓴이 | 승버미 | 작성시각 | 2011/11/16 17:30:23 |
|
|
|||
|
크롬에서는 정상적으로 이미지파일도 올라가고 DB에서 찍히는데 ie9 에서 테스트해보니 파일업로드 자체가 안되고 파일이 선택되지않았다는 에러 메세지가 뜨네요 ㅠㅠ ** 컨트롤러부분 **
function addPicture() {
$mediaData = $this->input->post();
$company_id = $this->input->post('media_company_id');
$config['upload_path']='image/picture/';
$config['allowed_types']='gif|jpg|png';
$this->load->library('upload',$config);
$field_name="c_picture";
if(! $this->upload->do_upload($field_name)) {
echo "<pre>";
print_r($mediaData);
$error = array('error' => $this->upload->display_errors());
print_r($error);
echo "</pre>";
} else {
$data = array('upload_data' => $this->upload->data());
$mediaData['media_url'] = $data['upload_data']['file_name'];
$this->load->model('startup/media_model');
$this->media_model->add_media($mediaData);
$successData['company_id'] = $company_id;
$this->load->view('company/picture/uploadSuccessPage', $successData);
}
}
** 출력내용은 다음과 같습니다 **
Array
(
[c_picture] => 20110712233238.jpg
[media_company_id] => 204
)
Array
(
[error] =>
ㅠ.ㅠ |
|||
| 다음글 | 업로드 오류 문의 (8) | ||
| 이전글 | 주소문제 고수님 봐주세요 ㅜㅜ (3) | ||
|
승버미
/
2011/11/16 17:32:37 /
추천
0
|
|
변종원(웅파)
/
2011/11/16 18:55:52 /
추천
0
구문상으로는 이상이 없는 것 같은데요.
혹시 모르니까 var_dump($_FILES); 이걸 do_upload() 전에 찍어보세요. |
|
한대승(불의회상)
/
2011/11/16 20:22:17 /
추천
0
흠... 이 부분이 이상하군요.
<form ... enctype="multipat/form-data"> 요렇게 수정해 주세요. <form ... enctype="multipart/form-data"> |
|
승버미
/
2011/11/17 09:34:26 /
추천
0
매번 답해주시는 웅파님 회상님 감사합니다^^ 덕분에 해결되었어요!! ㅋ
|
<div id="pictureAddForm"> <form method="post" action="<?=DOC_ROOT?>/index.php/startup/addPicture" enctype="multipat/form-data"> <table> <thead> <tr> <th colspan="2"><?=$this->lang->line('picture_info')?></th> </tr> </thead> <tfoot> <tr> <td> <input class="btn" type="submit" value="<?=$this->lang->line('funding_reg')?>" /> </td> </tr> </tfoot> <tbody> <tr> <td><input type="file" name="c_picture"></td> </tr> </tbody> </table> <input type="hidden" name="media_company_id" value="<?=$company_id?>" /> </form> </div>