• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload Multiple image

Hi everyone, i'm new to the codeigniter fóruns,

I need some help uploading multiple files..

I would like to do an upload form with information and with image upload

Since this is for products the images must be uploaded to the right place..


I'm passing the variable through the url so i can "know" where to save in the database, but i'm getting really trouble with the upload, because i wanted to upload multiple images with the progress bar and i also wanted to save the filename and description in the database..

Need some help here,


[eluser]Bias Tegaralaga[/eluser]
try javascript library, plupload for example.

I've made some progress,

got a small doubt, how do i save the file with the temp_name instead of the file name ?

$_FILES['userfile']['name'] = $value['name'][$s];
$_FILES['userfile']['type'] = $value['type'][$s];
$_FILES['userfile']['tmp_name'] = $value['tmp_name'][$s];
$_FILES['userfile']['error'] = $value['error'][$s];
$_FILES['userfile']['size'] = $value['size'][$s];

$config['upload_path'] = './uploads/produtos/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = '300';
$config['max_width'] = '1000';
$config['max_height'] = '1000';

$this->load->library('upload', $config);

$data = $this->upload->data();

Got all the stuff working, just want to save the images with the tmp_name, don't want to original name file, plus i'm missing i want to know how to validate the uploaded imagens, check if the size is < than the size in my config, plus the width and the heigh..


Found it, just missing the validation on the image, need some help here...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.