|
如题:html码:
<?= form_open_multipart('ackground_t/update'); ?>
<div>图片:<input name="userfile" type="file" /></div>
<br />
<div>
<input type="submit" value="修改" />
</div>
</form>
控制器代码:
class Ackground_t extends Controller {
function Ackground_t()
{
parent::Controller();
$this->load->database(); ;
$this->load->helper('url');
$this->load->helper('form');
}
function update()
{
$config['upload_path'] = './image/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload',$config);
}
提交后找不到上传的文件,不知是否上传成功?
再问就按手册上说在根目录创建存放上传文件夹,根目录指到啊? |
|