srs81 / CakePHP-AjaxMultiUpload

CakePHP 2 plugin to allow for easy multi-file upload with AJAX
Other
65 stars 32 forks source link

Undefined variable: result in AjaxMultiUpload\View\Upload\upload.ctp, line 1 #52

Closed nandosb closed 9 years ago

nandosb commented 9 years ago

When the file uploads is success, there is a warning due an undefined variable "$result". $result is only used for displaying errors but isn´t set for success cases

I suggest to add the following snippet in the upload method

UploadsController.php line 64 else{ $result = array('ok' => 'upload success'); $this->set("result", htmlspecialchars(json_encode($result), ENT_NOQUOTES)); $this->response->type('json'); $this->response->statusCode(200); }

srs81 commented 9 years ago

Hi, I've updated the code to be very similar to what you've outlined. Can you check and confirm that it works fine now?

Thanks for bringing this up! :) Really appreciate it.