I am having a problem with CakePHP 1.3. I’m using a jQuery plugin for uploading images, and works well only in Firefox. When I get a picture in Google Chrome, the image is uploaded, but at the end of the request is deleted. It is very strange. Then I started to debug, and it turns out after saving the image, I’m saving the image name in session, like this $this->Session->write("tmp_img_name, $ new_img_path), which is causing the problem to me because when I comment this line, image uploading is not deleted. it’s very strange that this line is erased images.
When I set in core.php debug = 0 this problem does not happen again, even if I uncomment the line causing the problem.
The plugin I’m using is the one on the following url http://www.phpletter.com/Our-Projects/AjaxFileUpload/
Thanks in advance.
You should really turn debug off for ajax actions that return any formatted data like json, as any text from a warning/error/debug message will mess up the json data format and things will start to fail. This is why you are not seeing the problem with debug set to 0.
I have this in my
AppController::beforeFilter():As for the session stuff, we really need to see more related code.