Scroll to top

Haloo! Selamat Datang di Komunitas Private Training Web Development (34798 Members, 307 Projects, 3058 Topic, 8539 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time) untuk mengerjakan project/aplikasi anda?, cari disini : Members Area Jobs!
Multiple Upload - Upload Lebih Dari 1 File Gambar Codeigniter
Budi Darma Mengatakan : Members -
  1. #ask
  2. Mhn bantuannya untuk insert gambar lebih dari 1 ke 1 tabel jadi field nya
  3. id_cus | gambar1 |gambar2
  4.  
  5. Dengan codeigniter
Bukhari al Muslim Mengatakan :
Admin -
  1. Assalam,.. seperti ini caranya gan :
  2.  
  3. File 1 <input type="file" name="userfile">
  4. Fiel 2 <input type="file" name="userfile2">
  5.  
  6. public function save() {
  7. $data = array();
  8. $config['upload_path'] = './uploads/';
  9. $config['allowed_types'] = 'jpg|png';
  10. $config['max_size'] = 5024;
  11. $config['encrypt_name'] = true;
  12.  
  13. $this->load->library('upload', $config);
  14.  
  15. if (!$this->upload->do_upload('userfile')) {
  16. $error = array('error' => $this->upload->display_errors());
  17. } else {
  18. $fileData = $this->upload->data();
  19. $data['userfile'] = $fileData['file_name'];
  20. }
  21.  
  22. if (!$this->upload->do_upload('userfile2')) {
  23. $error = array('error' => $this->upload->display_errors());
  24. } else {
  25. $fileData = $this->upload->data();
  26. $data['userfile2'] = $fileData['file_name'];
  27. }
  28. }

Maaf, Untuk Memberikan Komentar Anda Harus Login !!!