public function save()
 {
     // The JPEG snapshot is sent as raw input:
     $rInput = Framework\File\Stream::getInput();
     // Blank image. We don't need this one.
     if (md5($rInput) == '7d4df9cc423720b7f1f3d672b89362be') {
         exit(1);
     }
     $rResult = file_put_contents($this->sTmpPathFile, $rInput);
     if (!$rResult) {
         echo '{
     "error"     : 1,
     "message"   : "Failed save the image. Make sure you chmod the uploads folder and its subfolders to 777."
     }';
         exit;
     }
     return $this;
 }
 /**
  * @return void
  */
 private function _inputs()
 {
     switch ($this->getRequestMethod()) {
         case HttpRequest::METHOD_POST:
             $this->_aRequest = $this->_cleanInputs($_POST);
             break;
         case HttpRequest::METHOD_GET:
         case HttpRequest::METHOD_DELETE:
             $this->_aRequest = $this->_cleanInputs($_GET);
             break;
         case HttpRequest::METHOD_PUT:
             parse_str(Stream::getInput(), $this->_aRequest);
             $this->_aRequest = $this->_cleanInputs($this->_aRequest);
             break;
         default:
             $this->response('', 406);
             break;
     }
 }
 /**
  * Get the Post Data.
  *
  * @return array
  */
 protected function getPostDatas()
 {
     $rRawPost = Stream::getInput();
     $aRawPost = explode('&', $rRawPost);
     $aPostData = array();
     foreach ($aRawPost as $sKeyVal) {
         $aKeyVal = explode('=', $sKeyVal);
         if (count($aKeyVal) == 2) {
             $aPostData[$aKeyVal[0]] = Url::encode($aKeyVal[1]);
         }
         unset($aKeyVal);
     }
     unset($aRawPost);
     return $aPostData;
 }