Welcome Guest, Not a member yet? Register   Sign In
Help not getting the image_height
#1

[eluser]Exxon[/eluser]
I am in the process of creating a filemanager for fckeditor for my cms. But when I upload the images I get the error that image_height (As this would contain the height according to the documentation) is undefined !

I followed the example in the user guide

Code:
$config['upload_path'] = 'resources/api/website_files/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size']    = '2000';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$config['encrypt_name'] = true;
$config['overwrite'] = false;

$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('file')) { display errors here }
else {
$updata = $this->upload->data();

$idata = array(
                                        'type' => 1 ,
                                       'website' => $website ,
                                       'user' => $this->websites->get_user_id($data) ,
                                       'name' => $updata["orig_name"],
                                       'filename' => $updata["file_name"],
                                       'size' => $updata["file_size"],
                                        'width' => (isset ($updata["image_width"])) ? $updata["image_width"] : 0,
                                        'height' => (isset ($updata["image_heigth"])) ? $updata["image_heigth"] : 0,
                                       'mime' => $updata["image_type"],
                                    );
}

Thanks
#2

[eluser]Craig300[/eluser]
Hi,

Just spotted a spelling mistake that could be causing it

Code:
'height' => (isset ($updata["image_heigth"])) ? $updata["image_heigth"] : 0,

should be this:

Code:
'height' => (isset ($updata["image_height"])) ? $updata["image_height"] : 0,

Hope this helps...
#3

[eluser]Exxon[/eluser]
Your kidding wow....

Thanks
#4

[eluser]Craig300[/eluser]
Sometimes the simplest things are the hardest things to find Smile

Did it work by the way?
#5

[eluser]Exxon[/eluser]
Yes thanks did had me pulling my hair for a hour!
#6

[eluser]Exxon[/eluser]
Finally almost have a fully working file manager.
#7

[eluser]Craig300[/eluser]
Looks good, does that allow you to delete and amend pictures etc? I have done a similar thing for a gallery and to allow the upload of banners to a site.
#8

[eluser]Exxon[/eluser]
Delete is the next function i'm working on but what would you mean amend pictures, if upload more then yes and totally ajax-ed. The size and total upload space is calculated based on their websites' package that they chose.
#9

[eluser]Craig300[/eluser]
Sounds like a nice piece of coding, would be nice to see it when its totally finished Smile

I have a full admin backend system for a CMS but needs a bit of ajax in some places.
#10

[eluser]Exxon[/eluser]
Thanks but the thing is I hope that I will see it finished too. Just so busy Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB