CC-5709: Airtime Analyzer

* Fix the callback URL
* Imports files successfully now!
This commit is contained in:
Albert Santoni 2014-03-13 14:59:48 -04:00
parent c0aee37e37
commit 9b390518b7
1 changed files with 6 additions and 4 deletions

View File

@ -66,13 +66,14 @@ class Rest_MediaController extends Zend_Rest_Controller
return;
}
$this->processUploadedFile($this->getRequest()->getRequestUri());
//TODO: Strip or sanitize the JSON output
$file = new CcFiles();
$file->fromArray($this->getRequest()->getPost());
$file->save();
$callbackUrl = $this->getRequest()->getScheme() . '://' . $this->getRequest()->getHttpHost() . $this->getRequest()->getRequestUri() . "/" . $file->getPrimaryKey();
$this->processUploadedFile($callbackUrl);
$this->getResponse()
->setHttpResponseCode(201)
->appendBody(json_encode($file->toArray(BasePeer::TYPE_FIELDNAME)));
@ -200,3 +201,4 @@ class Rest_MediaController extends Zend_Rest_Controller
}
}