|
$w_path='static/files/';
$config['upload_path']=$w_path;//文件上传目录
if(!file_exists($w_path)){
mkdir($w_path,0777,true);//原图路径
}
$config['allowed_types'] = 'jpg|png|jpeg';
$config['max_size'] = 2048;
$config['file_name']='a_'.date('YmdHis').'_'.rand(1000,9999);
$config['max_width'] = 600;
$config['max_height'] = 400;
// $config['encrypt_name'] = TRUE;
$this->load->library('upload', $config);
// $this->upload->initialize($config);
//执行上传
$shang=$this->upload->do_upload('upto');
var_dump($shang);
$info=$this->upload->data();
p($info);die;
<form method="post" action="<?php echo site_url('baby_b_class/pic_post/');?>" ecnctype="multipart/form-data">
<input type="file" name="upto" value="上传" />
</tbody></table>
<div style="text-align:center; display: inline-block; width: 60%; margin-top: 20px; margin-left:40px;" ><input id="submit" type="submit" value="确认修改" class="mybtn"></div>
</form> |
|