gallery.php -보기CodeIgniter : 이미지가 업로드되지 않습니다.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<title>CI Gallery</title>
</head>
<body>
<div id="upload">
<?php
$this->load->helper("form");
echo form_open_multipart('gallery/up');
?>
<input type="file" name="file">
<?php
echo form_submit('upload','Upload');
echo form_close();
?>
</div>
</body>
</html>
gallery.php 컨트롤러이 내 코딩 파일입니다
<?php
class Gallery extends CI_Controller {
function index()
{
$this->load->view('gallery');
}
function up()
{
$config['upload_path'] = './images/';
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = '1000000';
$config['max_width'] = '10240';
$config['max_height'] = '7680';
$this->load->library('upload',$config);
$this->upload->do_upload('file');
$this->load->view('gallery');
}
}
. 여기서 파일이 업로드되지 않습니다. 누군가 도와주세요. 라이브러리 업로드가로드되지 않아 작동이 멈춘다 고 느낍니다. 그것이 문제를 해결하는 방법이 문제라면. 당신의 HTML에서
그는 form 태그를 가지고 있습니다. form_open_multipart입니까? – Albzi
@BeatAlex, 예, 건설적인 것이 아닙니다. – SagarPPanchal