Welcome Guest, Not a member yet? Register   Sign In
file multiupload config problem
#1

[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!
#2

[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
#3

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

[eluser]beringer[/eluser]
up




Theme © iAndrew 2016 - Forum software by © MyBB