I've written an application where I do multiple file uploads in the background using AJAX, so its definitely possible.
Personally I don't use the built in ajax functionality because I prefer jquery to the prototype library. I tend to do it by hand. If you do it that way, the trick is to realise that the data doesn't come in $this->data but in $this->params['form'] (well, mostly in form). do a quick debug on the $this->params and you should see the data that you're passing through. Hope you come right. On Mar 2, 11:36 pm, Miles J <[email protected]> wrote: > File uploading with AJAX is impossible. > > You'll have to use a plugin/library to do mimic > it:http://valums.com/ajax-upload/ > > On Mar 2, 12:37 pm, donnerbeil <[email protected]> wrote: > > > Hi all, > > > I'm trying to upload images with ajax. But in my controller in this->data > > only the values of the text input fields arrive, but not the > > > file array. Without ajax, everything works perfect. > > > Here is my view: > > > <?php echo $ajax->form(array('type' => 'file', > > 'options' => array( > > 'model'=>'Image', > > 'update'=>'image_box', > > 'url' => array( > > 'controller' => 'images', > > 'action' => 'add' > > ) > > ) > > )); > > ?> > > <fieldset> > > <legend><?php __('upload image');?></legend> > > <?php > > echo > > $form->input('Image.file',array('type'=>'file','label'=>__('upload > > > image',true))); > > echo $form->input('Image.title',array('label'=>__('image > > title',true))); > > echo $form->end(__('upload',true)); > > ?> > > </fieldset> > > > Instead of $form->end I also tried with $ajax->submit (and $form->create(), > > because ajax->submit and $ajax->form together cause a known > > > issue) > > > I couldn't find much about file upload with ajax in cake > > > Any ideas? > > > Thanks > > > Donnerbeil 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
