CodeIgniter Forums
file multiupload config problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: file multiupload config problem (/thread-39254.html)



file multiupload config problem - El Forum - 03-05-2011

[eluser]beringer[/eluser]
Hi!

To upload multiple images with jquery and ajax I'm using Multi_upload library that i found somewhere in the forum . Everything works perfect except that if I try to upload file bigger than max_width and max_height it works too.

Code:
$config = array(
                'upload_path' => '../uploads/post',
                'allowed_types' => 'jpg|jpeg|png|gif',
                'max_size' => 2048,
                'max_width' => 1024,
                'max_height' => 768,
                'encrypt_name' => TRUE
            );

            $this->load->library('upload', $config);
            $this->load->library('Multi_upload');
            $this->load->library('image_lib');
            $files = $this->multi_upload->go_upload();

foreach ($files as $row) {

                $resize['image_library'] = 'gd2';
                $resize['source_image'] = '../uploads/post/' . $row['name'];
                $resize['new_image'] = '../uploads/post/thumbs/' . $row['name'];
                $resize['maintain_ratio'] = TRUE;
                $resize['width'] = 200;
                $resize['height'] = 150;

                $this->image_lib->initialize($resize);
                $this->image_lib->resize();

                $pic = array(
                    'upl_name' => $row['name'],
                    'upl_cat' => $id,
                    'upl_post' => 0
                );

                $this->ajax_model->imgUpl($pic);
            }

Am I doing something wrong? Help me, please!


file multiupload config problem - El Forum - 03-05-2011

[eluser]beringer[/eluser]
i forgot to say that if the file is bigger it didn't make a thumb file and database record, just uploads original file


file multiupload config problem - El Forum - 03-07-2011

[eluser]Bigil Michael[/eluser]
can u post the model view and controller code


file multiupload config problem - El Forum - 03-09-2011

[eluser]beringer[/eluser]
up