Tuesday, February 1, 2011

Re: Uploading Image with MeioUpload and No Table

On Mon, Jan 31, 2011 at 9:29 PM, Arak Tai'Roth <nielsen.dustin@gmail.com> wrote:
> Hey there,
>
> So, something I've been stumbling around for a little bit now and
> can't seem to find any references regarding. I am using MeioUpload for
> my image file upload behaviour. It's working great, no issues there.
>
> However, I am now using it on a form that isn't linked to a database,
> as no data is saved in the database. But I want it to upload the file.
> However, I noticed that it's upload file portion is called with a
> beforeSave callback. But I can't call a save function in my controller
> because I'm not saving any data and have no table to save to.
>
> So, I am stuck here trying to puzzle out how to upload this file
> without calling the save method. I did notice in the code for
> MeioUpload that it has a function called upload that in the comments
> is used for "performing a manual upload". I figure that must be what I
> want to use, but I am unaware how to call a function in a behavior
> either from my model or from my controller.
>
> Just wondering if anyone is able to help me out with this. Thanks in
> advance.

You can call a Behavior's methods as if they belonged to the model.
I've never used this MeioUpload so I can't say what you should do, but
I can recommend Nick Baker's FileUpload plugin. It does what you want.
http://www.webtechnick.com/blogs/view/221/CakePHP_File_Upload_Plugin

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

No comments: