src/Model/Table/FeedbackstoreTable.php
private function saveScreenshot(array $feedbackObject) {
		//Get save path from config
		$savepath = ROOT . DS . 'files' . DS . 'img' . DS . 'screenshots' . DS;

		//Serialize and save the object to a store in the Cake's tmp dir.
		if (!file_exists($savepath)) {
			if (!mkdir($savepath)) {
				//Throw error, directory is requird
				throw new NotFoundException('Could not create directory to save screenshots in. Please provide write rights to webserver user on directory: ' . $savepath);
			}
		}

		$screenshotname = $this->generateScreenshotName();

		if (file_put_contents($savepath . $screenshotname, base64_decode($feedbackObject['screenshot']))) {
			//Return the screenshotname
			return $screenshotname;
		}

		return null;
	}
private function saveScreenshot(array $feedbackObject) {
		//Get save path from config
		$savepath = ROOT . DS . 'files' . DS . 'img' . DS . 'screenshots' . DS;

		//Serialize and save the object to a store in the Cake's tmp dir.
		if (!file_exists($savepath)) {
			if (!mkdir($savepath)) {
				//Throw error, directory is requird
				throw new NotFoundException('Could not create directory to save screenshots in. Please provide write rights to webserver user on directory: ' . $savepath);
			}
		}

		$screenshotname = $this->generateScreenshotName();

		if (file_put_contents($savepath . $screenshotname, base64_decode($feedbackObject['screenshot']))) {
			//Return the screenshotname
			return $screenshotname;
		}

		return null;
	}
private function saveScreenshot ( array $ feedbackObject ) { //Get save path from config $ savepath = ROOT . DS . 'files' . DS . 'img' . DS . 'screenshots' . DS ; //Serialize and save the object to a store in the Cake's tmp dir. if ( ! file_exists ( $ savepath ) ) { if ( ! mkdir ( $ savepath ) ) { //Throw error, directory is requird throw new NotFoundException ( 'Could not create directory to save screenshots in. Please provide write rights to webserver user on directory: ' . $ savepath ) ; } } $ screenshotname = $ this -> generateScreenshotName ( ) ; if ( file_put_contents ( $ savepath . $ screenshotname , base64_decode ( $ feedbackObject [ 'screenshot' ] ) ) ) { //Return the screenshotname return $ screenshotname ; } return null ; }
Auxiliary function that save screenshot as image in webroot

@deprecated Make part of a Store class

@param array $feedbackObject

@return string|null
Auxiliary function that save screenshot as image in webroot