Logging messages for debugging the ftp script

This commit is contained in:
drigato 2014-04-16 11:01:02 -04:00
parent 8ae172b0bb
commit cf13952b45
1 changed files with 4 additions and 3 deletions

View File

@ -144,7 +144,7 @@ class Rest_MediaController extends Zend_Rest_Controller
$file->setDbUtime($now);
$file->setDbHidden(true);
$file->save();
Logging::info("POST --- file saved");
$callbackUrl = $this->getRequest()->getScheme() . '://' . $this->getRequest()->getHttpHost() . $this->getRequest()->getRequestUri() . "/" . $file->getPrimaryKey();
$this->processUploadedFile($callbackUrl, $_FILES["file"]["name"], $this->getOwnerId());
@ -337,12 +337,13 @@ class Rest_MediaController extends Zend_Rest_Controller
private function processUploadedFile($callbackUrl, $originalFilename, $ownerId)
{
Logging::info("POST --- process uploaded file begin");
$CC_CONFIG = Config::getConfig();
$apiKey = $CC_CONFIG["apiKey"][0];
$tempFilePath = $_FILES['file']['tmp_name'];
$tempFileName = basename($tempFilePath);
Logging::info("POST --- ".$tempFilePath);
//Only accept files with a file extension that we support.
$fileExtension = pathinfo($originalFilename, PATHINFO_EXTENSION);
if (!in_array(strtolower($fileExtension), explode(",", "ogg,mp3,oga,flac,wav,m4a,mp4,opus")))
@ -350,7 +351,7 @@ class Rest_MediaController extends Zend_Rest_Controller
@unlink($tempFilePath);
throw new Exception("Bad file extension.");
}
Logging::info("POST --- ".$fileExtension);
//TODO: Remove uploadFileAction from ApiController.php **IMPORTANT** - It's used by the recorder daemon...
$storDir = Application_Model_MusicDir::getStorDir();