From d0ecd0acf161a5fbdd28a6045cdb9452d7a5da35 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 30 Aug 2011 15:25:33 -0400 Subject: [PATCH] CC-2740: Upload issue - fixed a bug for uploading a file with "+" signs in IE --- airtime_mvc/application/models/StoredFile.php | 5 +++-- airtime_mvc/public/js/airtime/library/plupload.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index b7bbac9d0..7ff0bb56b 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -728,7 +728,7 @@ class StoredFile { $chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0; $chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0; $fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : ''; - + Logging::log(__FILE__.':uploadFile(): filename='.$fileName); // Clean the fileName for security reasons //this needs fixing for songs not in ascii. //$fileName = preg_replace('/[^\w\._]+/', '', $fileName); @@ -823,7 +823,7 @@ class StoredFile { public static function copyFileToStor($p_targetDir, $fileName){ $audio_file = $p_targetDir . DIRECTORY_SEPARATOR . $fileName; - + Logging::log('copyFileToStor: moving file '.$audio_file); $md5 = md5_file($audio_file); $duplicate = StoredFile::RecallByMd5($md5); if ($duplicate) { @@ -844,6 +844,7 @@ class StoredFile { $audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName; $r = @copy($audio_file, $audio_stor); + //$r = @unlink($audio_file); } public static function getFileCount() diff --git a/airtime_mvc/public/js/airtime/library/plupload.js b/airtime_mvc/public/js/airtime/library/plupload.js index 76bdf532b..3fac56d6a 100644 --- a/airtime_mvc/public/js/airtime/library/plupload.js +++ b/airtime_mvc/public/js/airtime/library/plupload.js @@ -25,7 +25,7 @@ $(document).ready(function() { $("#plupload_error").find("table").append(row); }else{ - $.get('/Plupload/copyfile/format/json/name/'+file.name, function(json){ + $.get('/Plupload/copyfile/format/json/name/'+encodeURIComponent(file.name), function(json){ var jr = jQuery.parseJSON(json); if(jr.error !== undefined) { var row = $("")