CC-5709: Airtime Analyzer
* Bounce files with file extensions we don't support in MediaController * Added translation stuff for Recent Uploads
This commit is contained in:
parent
e4af3a5a0e
commit
1e62908e66
23 changed files with 52694 additions and 54641 deletions
|
@ -335,7 +335,15 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
|
||||
$tempFilePath = $_FILES['file']['tmp_name'];
|
||||
$tempFileName = basename($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")))
|
||||
{
|
||||
@unlink($tempFilePath);
|
||||
throw new Exception("Bad file extension.");
|
||||
}
|
||||
|
||||
//TODO: Remove uploadFileAction from ApiController.php **IMPORTANT** - It's used by the recorder daemon...
|
||||
|
||||
$storDir = Application_Model_MusicDir::getStorDir();
|
||||
|
@ -346,7 +354,9 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
//and accessible by airtime_analyzer which could be running on a different machine.
|
||||
$newTempFilePath = Application_Model_StoredFile::copyFileToStor($tempFilePath, $originalFilename);
|
||||
} catch (Exception $e) {
|
||||
@unlink($tempFilePath);
|
||||
Logging::error($e->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
Logging::info($newTempFilePath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue