|
就是用ci上传的图片,在控制器 查看$this->upload->data();时,不显示图片的相关信息,只显示:麻烦大家帮忙看一下,谢谢了
array 'file_name' => string '' (length=0) 'file_type' => string '' (length=0) 'file_path' => string './upload/' (length=9) 'full_path' => string './upload/' (length=9) 'raw_name' => string '' (length=0) 'orig_name' => string '' (length=0) 'client_name' => string '' (length=0) 'file_ext' => string '' (length=0) 'file_size' => string '' (length=0) 'is_image' => boolean false 'image_width' => string '' (length=0) 'image_height' => string '' (length=0) 'image_type' => string '' (length=0) 'image_size_str' => string '' (length=0)
这是我的控制器部分:
public function main(){
$data['userinfo'] = $this->user_info;
//接收上传的logo
if($this->input->post()){
$config['upload_path'] = './upload/'; //这个路径很重要
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '1024';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$this->upload->do_upload();
var_dump($this->upload->data());die; //问题是,打印出来的内容为空,不能显示图片的相关信息
}
$this->_template('user/uploadlogo',$data);
}
我的视图部分:
<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="upload" type="file" style="width:200;border:1 solid #9a9999; font-size:9pt; background-color:#ffffff" size="17">
<input type="submit" name="uploadimg" value="上 传 " style="width:42;border:1 solid #9a9999; font-size:9pt; background-color:#ffffff" size="17">
</form>
|
|