Saturday, July 31, 2010

Re: file uploading. problems with ajax and jquery

ok this is what i did

in my view and specifically in the div, where i want the uploaded
image to appear (told jquery to put it there in onclick), i included
this:

echo $this->element('previewProfileImage');

this ctp.-file is in views/elements/previewProfileImage.ctp

the content of this element is just for testing: (no idea yet how to
tell in the view: echo $html->image('profilepics/small/'.
$user['image_path']);)
echo "bla bla";


it works. but i still get all this other cake crap shown too..like the
sql and everything else...and not just "bla bla"

i'm getting nuts here....what am i doing wrong?

On 31 Jul., 22:45, "Dave Maharaj" <m...@davemaharaj.com> wrote:
> Well for my set up I create an element which simply has the "uploaded
> image". Use jQuery to get the response and tell it what DIV to place the
> content in.
>
> -----Original Message-----
> From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
> Sent: July-31-10 3:24 PM
> To: CakePHP
> Subject: Re: file uploading. problems with ajax and jquery
>
> dave, thx for the quick reply. i appreciate it.
>
> do you mind going into details a little? you render the div-section?
>
> On 31 Jul., 19:28, "Dave Maharaj" <m...@davemaharaj.com> wrote:
> > Render an element containing the image uploaded.
>
> > -----Original Message-----
> > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
> > Sent: July-31-10 2:54 PM
> > To: CakePHP
> > Subject: Re: file uploading. problems with ajax and jquery
>
> > ok i found the problem:
>
> > it has to be
> > <script type="text/javascript" src="../js/ajaxupload.js"></script>
>
> > not
> > <script type="text/javascript" src="js/ajaxupload.js"></script>
>
> > but i get another one:
>
> > i see the "...loading" text for the web 2.0 feeling, BUT:
>
> > a) the image wont be uploaded. so i guess my function in controller is
> > not called. and
> > b) because i have
> >         $this->redirect(array('controller' => 'users', 'action' =>
> > 'editprofile'));
> >     in my called function i get to see the whole site in the div,
> > where the uploaded pic should appear.
>
> > but if i delete the redirect, cake asks for a view. makes sense
> > though. what do i need to change, that the whole site wont be shown in
> > this div?
>
> > thx :)
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
> > with their CakePHP related questions.
>
> > 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
> athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> 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 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: