diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 852ac60bd..a728e8846 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -810,12 +810,9 @@ class Application_Model_StoredFile { $contentType = $_SERVER["CONTENT_TYPE"]; // create temp file name (CC-3086) - $command = "mktemp --tmpdir=".$p_targetDir; - $tempFilePath= exec($command); - - if($tempFilePath == ""){ - die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Unable to create tmp file."}, "id" : "id"}'); - } + // we are not using mktemp command anymore. + // plupload support unique_name feature. + $tempFilePath= $p_targetDir . DIRECTORY_SEPARATOR . $fileName; if (strpos($contentType, "multipart") !== false) { if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) { diff --git a/airtime_mvc/public/js/airtime/library/plupload.js b/airtime_mvc/public/js/airtime/library/plupload.js index 326fe8f8c..3a9bc616f 100644 --- a/airtime_mvc/public/js/airtime/library/plupload.js +++ b/airtime_mvc/public/js/airtime/library/plupload.js @@ -6,6 +6,7 @@ $(document).ready(function() { runtimes : 'gears, html5, html4', url : '/Plupload/upload/format/json', chunk_size: '5mb', + unique_names: 'true', multiple_queues : 'true', filters : [ {title: "Audio Files", extensions: "ogg,mp3"} @@ -52,7 +53,6 @@ $(document).ready(function() { uploadProgress = false; }); - $(window).bind('beforeunload', function(){ if(uploadProgress){ if(!confirm("You are currently uploading files.\nGoing to another screen will cancel the upload process.\nAre you sure you want to cancel the upload process and go to the screen you clicked on?")){