I’m trying to use MilesJ’s Upload plugin for CakePHP to upload a file via AJAX.
$this->Uploader = new Uploader();
$this->Uploader->setup(array('ajaxField' => 'qqfile'));
$data = $this->Uploader->upload($this->Uploader->ajaxField);
But it is returning false.
I haven’t found any mention on the FAQ about how to use AJAX. I just got to that code after reading from this ticket. But I’m not sure this is how I’m supposed to use the plugin to handle AJAX.
Problem solved.
ajaxFieldmust be passed when creating the object, not later using the setup().This worked just fine.