cake-php@googlegroups.com
[Top] [All Lists]

Image Upload

Subject: Image Upload
From: aSh!Q's
Date: Sat, 31 Mar 2012 12:41:41 -0700 PDT
I wanted to upload a picture of the user via ajax. I checked the media plugin but found it a little bit hard seeing all those instructions. Is there any better way ? What is the best way ?
I was thinking of using the submit option of the jshelper . And i created the following page. 



<?php

echo $this->Form->create('Photo',array('type'=>'file'));
echo $this->Form->file('Photo.image');
echo $this->Js->Submit('Add Picture',array('url'=>'/users/savepicture','class'=>'button',
'before'=>$this->Js->get('#right-box')->effect('fadeOut') ,
'success'=>$this->Js->get('#right-box')->effect('fadeIn'),'update'=>'#right-box'
));
echo $this->Form->end(); 
echo $this->Js->writebuffer();
?>


In the controller I tried to debug ($this->data) just to get an understanding of how the file is uploaded . But i see no data being uploaded . The debug returns an empty array . Help me ??

--
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@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php
<Prev in Thread] Current Thread [Next in Thread>
  • Image Upload, aSh!Q's <=