Sunday, December 30, 2012

Re: Dealing with Image Uploads

Hi,

I have this in one of my apps: if I remember correctly I used: http://github.com/josegonzalez/upload/zipball/master

It's well explained in the readme section. You can set different thumbnailsizes:

Code in the model:

public $actsAs = array(

        'Upload.Upload' => array(

            'foto'=> array(

            'pathMethod' => 'flat',

        'path' => '{ROOT}webroot{DS}files{DS}',

            'thumbnailSizes' => array(

                    'xvga' => '1024x768',

                    'vga' => '640x480',

                    'thumb' => '80x80'

                )),

                'audio1'=> array(

            'pathMethod' => 'flat',

        'path' => '{ROOT}webroot{DS}files{DS}'

                ),

                'audio2'=> array(

            'pathMethod' => 'flat',

        'path' => '{ROOT}webroot{DS}files{DS}'     

                ),
            ),
    ); 


On Friday, December 28, 2012 6:44:38 AM UTC+1, advantage+ wrote:

I need to figure out the best way from the backed the admin can upload images, the tricky part is the site has all different kinds of images (small product thumbs, large version, they want to be able to upload images into the jquery slider on the home page, images for a new sections, featured product on index page to name a few of the different sizes)

 

And there is no way to know if they are even going to upload the right dimensions for each type of image.

 

What is the best way to do this? I cannot seem to think of anything having a table for each_image how it relates to that page, that seems like the opposite of what should be done.

 

Any idea would be great.

 

Thanks, Dave

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: