jQuery多图像上传器是否插入数据库?
我目前正在使用jQuery的多图像上传程序来上传我在CI中的表单。这项工作非常出色,但是我想在数据库中插入文件名等,有人知道我该怎么做吗 我的控制器jQuery多图像上传器是否插入数据库?,jquery,database,codeigniter,Jquery,Database,Codeigniter,我目前正在使用jQuery的多图像上传程序来上传我在CI中的表单。这项工作非常出色,但是我想在数据库中插入文件名等,有人知道我该怎么做吗 我的控制器 $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|pdf|doc|bmp|png'; $config['max_size'] = '2024'; $config['max_width'] = '1024'; $config['m
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|pdf|doc|bmp|png';
$config['max_size'] = '2024';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$this->load->library('Multi_upload');
$files = $this->multi_upload-go_upload();
$data = array('upload_data' => $files);
我的看法
<input type="file" name="images[]" size="20" class="multi" id="images" maxlength="5" />
任何帮助都很好,谢谢 我不知道$this->multi\u upload->go\u upload()返回的是什么,但如果它返回上传文件的数组,您只需要执行foreach,然后执行sql插入
foreach($files as $file)
{
$insert = array(
'filename' => $file["name"],
'type' => $file["type"]
);
$this->db->insert('table', $insert);
}