ここで問題が発生しました。opencart で単純な複数アップロード機能を構築し、フォルダーにファイルを保存しますが、パス n mysql を保存しません。誰か助けてください。
意見 :
<input type="file" name="picture[]" accept="img/*" />
<input type="file" name="picture[]" accept="img/*" />
コントローラー:
foreach ($this->request->files['picture']['error'] as $key => $error) {
$tmp_name = $this->request->files['picture']['tmp_name'][$key];
$this->request->post['img'] = "test/".$this->request->files['picture']['name'][$key];
move_uploaded_file($tmp_name,DIR_IMAGE .$this->request->post['img']);
}
モデル :
$this->db->query("INSERT INTO " . DB_PREFIX . "product_image SET image = '" . $this->db->escape($data['img']) . "',product_id = '" . (int)$product_id . "'");