CI框架随记3
来源:互联网 发布:泰牛程序员靠谱吗 编辑:程序博客网 时间:2024/05/19 02:42
文件上传类
<?php
public function do_upload(){
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 100;
$config['max_width'] = 1024;
$config['max_height'] = 768;
//载入上传类
$this->load->library('upload', $config);
//执行上传
if ( ! $this->upload->do_upload('userfile'))
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{ //上传返回的信息
$data = array('upload_data' => $this->upload->data());
$this->load->view('upload_success', $data);
}
}
public function shangchuan(){
$info = $this->upload->data();
//上传缩略图----------------配置
$config['source_image']=$info['full_path'];
$config['create_thumb']=TRUE;//创建预览图像
$config['width']=75;
$config['height']=50;
//载入
$this->load->library('image_lib',$config);
//执行动作
$status = $this ->image_lib ->resize();
if(!$status){
error('缩略图失败');
}
}
?>
1 0
- CI框架随记3
- CI框架随记1
- CI框架随记2
- CI框架随记4
- CI框架随记5
- CI框架随记6
- CI框架学习3
- ci使用随记 1
- 《.Ne框架程序设计》随记(3)
- ci框架
- CI框架
- CI框架
- CI 开始学习CI框架
- 【ci框架】CI超级对象
- CI框架快速入门3--快速开发
- CI框架(3)-基本设置
- PHP(3)--CI框架的使用
- tp框架、ci框架
- ios运行内存
- 理解 Linux 网络栈(1):Linux 网络协议栈简单总结
- Android:pt 、sp、dp之间的换算
- php 万年日历
- shell小技巧
- CI框架随记3
- Docker安装
- git pull --rebase丢文件丢失修改了怎么办
- day01
- 如何真正的从细节上节省网站用户的时间
- 一道关于fork的笔试题
- 输入一个正数s,打印出所有和为s的连续正数序列
- Unsupported major.minor version 原理
- Springcache 应用配置说明