Monday, April 27, 2009

Re: MeioUpload Problem

That was the next step, I was just hoping someone here had seen this
problem before and had a solution already worked out, save me some
work.

On Apr 27, 11:15 am, brian <bally.z...@gmail.com> wrote:
> I didn't expect that was the cause, but you never know. I just thought
> it looked a little odd.
>
> Perhaps you should add a bunch of debugging statements to the behavior:
>
> Debugger::log(...)
>
> On Mon, Apr 27, 2009 at 12:37 PM, Arak Tai'Roth
>
> <nielsen.dus...@gmail.com> wrote:
>
> > Yea, that didn't help. I was pretty sure it wouldn't, MeioUpload
> > doesn't actually require that you store filesize and mimetype, and I
> > have never done so because I've never needed that information.
>
> > On Apr 26, 10:47 am, brian <bally.z...@gmail.com> wrote:
> >> Wait a sec. You have both banner and poster fields, so you have to
> >> specify the fields for both mimetype and filesize. You need one for
> >> each upload. From the MeioUpload page:
>
> >> var $actsAs = array(
> >>         'picture' => array(
> >>                 'fields' => array(
> >>                         'filesize' => 'picture_filesize',
> >>                         'mimetype' => '{field}_mimetype',
> >>                         'dir' => 'pictures_folder'
> >>                 )
> >>         )
> >> );
>
> >> So, it appears that your $actsAs should, at minimum, look like:
>
> >> var $actsAs = array(
> >>         'MeioUpload' => array(
> >>                 'banner' => array(
> >>                         'dir' => 'img/events/banners',
> >>                         'create_directory' => false,
> >>                         'allowed_mime' => array(
> >>                                 'image/jpeg',
> >>                                 'image/pjpeg',
> >>                                 'image/png'
> >>                         ),
> >>                         'allowed_ext' => array(
> >>                                 '.jpeg', '.jpg', '.png'
> >>                         ),
> >>                         'thumbsizes' => array(
> >>                                 'large' => array(
> >>                                         'width' => 950,
> >>                                         'height' => 170
> >>                                 )
> >>                         ),
> >>                         'fields' => array(
> >>                                 'filesize' => '{field}_filesize',
> >>                                 'mimetype' => '{field}_mimetype'
> >>                         )
> >>                 ),
> >>                 'poster' => array(
> >>                         'dir' => 'img/events/posters',
> >>                         'create_directory' => false,
> >>                         'allowed_mime' => array(
> >>                                 'image/jpeg',
> >>                                 'image/pjpeg',
> >>                                 'image/png'
> >>                         ),
> >>                         'alowed_ext' => array(
> >>                                 '.jpeg', '.jpg', '.png'
> >>                         ),
> >>                         'thumbsizes' => array(
> >>                                 'large' => array(
> >>                                         'width' => 300, 'height' => 465
> >>                                 )
> >>                         ),
> >>                         'fields' => array(
> >>                                 'filesize' => '{field}_filesize',
> >>                                 'mimetype' => '{field}_mimetype'
> >>                         )
> >>                 )
> >>         ),
> >>         'Sluggable' => array(
> >>                 'label' => 'name',
> >>                 'overwrite' => true
> >>         )
> >> );
>
> >> Although, because the {field} placeholder is used, you might be able
> >> to place the 'fields' array at the same level as 'banner' & 'poster'
> >> (ie. don't repeat it).
>
> >> On Sun, Apr 26, 2009 at 4:05 AM, Arak Tai'Roth <nielsen.dus...@gmail.com> wrote:
>
> >> > I'm not going to touch on form->label, that isn't a part of my
> >> > question.
>
> >> > I have looked at the code and can't figure out what is breaking, hence
> >> > why I am asking here if anyone knows. The behaviour works for the
> >> > first item (banners) just fine, uploads and thumbnails them perfectly.
> >> > Same with other pages that I have only one file being uploaded, it
> >> > works great. The problem is with the second file being uploaded, it
> >> > uploads perfectly fine, it just doesn't get thumbnailed.
>
> >> > On Apr 25, 3:38 pm, Aivaras <faifas1...@gmail.com> wrote:
> >> >> Why in this world you're using $form->label()? CakePHP isn't that
> >> >> complicated :o
>
> >> >> Did you actually check for any errors in the behaviour itself? Try to debug
> >> >> parts of the code: start with small ones then go bigger and see where it
> >> >> breaks. Then you will definitely find an answer :)
>
> >> >> Cheers,
> >> >> Faifas
>
> >> >> On Sat, Apr 25, 2009 at 01:18, Arak Tai'Roth <nielsen.dus...@gmail.com>wrote:
>
> >> >> > Anyone at all? I could really use some help on this.
>
> >> >> > On Apr 21, 1:02 pm, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:
> >> >> > > Anyone have any ideas on this topic?
>
> >> >> > > On Apr 20, 5:16 pm, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:
>
> >> >> > > > Yup, the exact same permissions as the banners directory
>
> >> >> > > > On Apr 20, 4:09 pm, brian <bally.z...@gmail.com> wrote:
>
> >> >> > > > > Are the permissions for the posters dir good?
>
> >> >> > > > > On Mon, Apr 20, 2009 at 4:56 PM, Arak Tai'Roth <
> >> >> > nielsen.dus...@gmail.com> wrote:
>
> >> >> > > > > > So I have my MeioUpload set up:
>
> >> >> > > > > >                var $actsAs = array(
> >> >> > > > > >                        'MeioUpload' => array(
> >> >> > > > > >                                'banner' => array(
> >> >> > > > > >                                        'dir' =>
> >> >> > 'img/events/banners',
> >> >> > > > > >                                        'create_directory' => false,
> >> >> > > > > >                                        'allowed_mime' =>
> >> >> > array('image/jpeg', 'image/pjpeg', 'image/
> >> >> > > > > > png'),
> >> >> > > > > >                                        'allowed_ext' =>
> >> >> > array('.jpeg', '.jpg', '.png'),
> >> >> > > > > >                                        'thumbsizes' => array(
> >> >> > > > > >                                                'large' =>
> >> >> > array('width' => 950, 'height' => 170)
> >> >> > > > > >                                        )
> >> >> > > > > >                                ),
> >> >> > > > > >                                'poster' => array(
> >> >> > > > > >                                        'dir' =>
> >> >> > 'img/events/posters',
> >> >> > > > > >                                        'create_directory' => false,
> >> >> > > > > >                                        'allowed_mime' =>
> >> >> > array('image/jpeg', 'image/pjpeg', 'image/
> >> >> > > > > > png'),
> >> >> > > > > >                                        'alowed_ext' =>
> >> >> > array('.jpeg', '.jpg', '.png'),
> >> >> > > > > >                                        'thumbsizes' => array(
> >> >> > > > > >                                                'large' =>
> >> >> > array('width' => 300, 'height' => 465)
> >> >> > > > > >                                        )
> >> >> > > > > >                                )
> >> >> > > > > >                        ),
> >> >> > > > > >                        'Sluggable' => array(
> >> >> > > > > >                                'label' => 'name',
> >> >> > > > > >                                'overwrite' => true
> >> >> > > > > >                        )
> >> >> > > > > >                );
>
> >> >> > > > > > and it works great. However there is one problem, the poster
> >> >> > picture
> >> >> > > > > > uploads, but no thumbnail is generated. I can't figure out for the
> >> >> > > > > > life of my why no thumbnail is generated. My code for the add and
> >> >> > edit
> >> >> > > > > > views are:
>
> >> >> > > > > >                        echo $form->label('Event.banner',
> >> >> > 'Banner:');
> >> >> > > > > >                        echo $form->input('Event.banner',
> >> >> > array('label' => false, 'type' =>
> >> >> > > > > > 'file'));
>
> >> >> > > > > >                        echo $form->label('Event.poster',
> >> >> > 'Poster:');
> >> >> > > > > >                        echo $form->input('Event.poster',
> >> >> > array('label' => false, 'type' =>
> >> >> > > > > > 'file'));
>
> >> >> > > > > > So still the same code between them, just different variable names,
> >> >> > > > > > yet it doesn't work.
>
> >> >> > > > > > Does anyone have a clue why the banner image would be uploaded and
> >> >> > > > > > thumbnailed appropriately, but the poster image wouldn't be?
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: