Image upload data empty
当前具有这些代码。
1 2 3 4 5 6 | $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '1000'; $config['max_width'] = '270'; $config['max_height'] = '280'; $this->load->library('upload', $config); |
然后将详细信息插入数据库。
1 | $this->Model->upload_image($this->upload->data(),$result_id); |
但是数据库行是空的,所以我检查了一下自己。 I
1 |
不过,结果还是空白。
Array ( [file_name] => [file_type] => [file_path] => ./uploads/
[full_path] => ./uploads/ [raw_name] => [orig_name] => [client_name]
=> [file_ext] => [file_size] => [is_image] => [image_width] => [image_height] => [image_type] => [image_size_str] => )
编辑:
1 2 3 4 5 6 7 8 9 10 |
如果您为
例如
1 2 | $field_name ="some_field_name"; $this->upload->do_upload($field_name) |
默认情况下,上传例程希望文件来自名为userfile的表单字段,并且该表单必须为" multipart type
请参见参考文献
http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html
上面链接
中