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

#1
[eluser]KaMiii[/eluser]
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..

localhost/app/produtos/produtos_ins?a=50

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,

Regards.

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

#3
[eluser]KaMiii[/eluser]
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);

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

#4
[eluser]KaMiii[/eluser]
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..

Regards.

#5
[eluser]KaMiii[/eluser]
Found it, just missing the validation on the image, need some help here...

Regards.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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