From 28f664e6eb096b5f337a19ecf19b7f0225bee2fd Mon Sep 17 00:00:00 2001 From: atomaka Date: Sat, 5 Nov 2011 12:58:23 -0400 Subject: [PATCH] Unmodified files listing as modified even though they are not; commit to clear status. --- application/config/mimes.php | 12 ++++++------ application/controllers/upload.php | 3 +-- js/jquery.filedrop.js | 9 +++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/application/config/mimes.php b/application/config/mimes.php index 950002a..82767d7 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -66,12 +66,12 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'ra' => 'audio/x-realaudio', 'rv' => 'video/vnd.rn-realvideo', 'wav' => 'audio/x-wav', - 'bmp' => array( 'image/bmp', 'application/octet-stream'), - 'gif' => array( 'image/gif', 'application/octet-stream'), - 'jpeg' => array('image/jpeg', 'image/pjpeg', 'application/octet-stream'), - 'jpg' => array('image/jpeg', 'image/pjpeg', 'application/octet-stream'), - 'jpe' => array('image/jpeg', 'image/pjpeg', 'application/octet-stream'), - 'png' => array('image/png', 'image/x-png', 'application/octet-stream'), + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => array('image/jpeg', 'image/pjpeg'), + 'jpg' => array('image/jpeg', 'image/pjpeg'), + 'jpe' => array('image/jpeg', 'image/pjpeg'), + 'png' => array('image/png', 'image/x-png'), 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'css' => 'text/css', diff --git a/application/controllers/upload.php b/application/controllers/upload.php index 10744df..0e2df17 100644 --- a/application/controllers/upload.php +++ b/application/controllers/upload.php @@ -18,8 +18,7 @@ class Upload extends CI_Controller { if (!$this->upload->do_upload('image')) { $message = array('type' => 'error', 'status' => $this->upload->display_errors()); } else { - $data = array('upload_data' => $this->upload->data()); - $message = array('type'=>'success','status'=>'Uploaded successfully','file'=>'http://screens.p5dev.com/' . $data['file_name']); + $message = array('type'=>'success','status'=>'Uploaded successfully','file'=>'http://screens.p5dev.com/' . $config['file_name']); } echo json_encode($message); diff --git a/js/jquery.filedrop.js b/js/jquery.filedrop.js index 2fa1cc4..1d4f582 100644 --- a/js/jquery.filedrop.js +++ b/js/jquery.filedrop.js @@ -80,7 +80,7 @@ return false; } - function getBuilder(filename, filedata, boundary) { + function getBuilder(filename, filedata, mime, boundary) { var dashdash = '--', crlf = '\r\n', builder = ''; @@ -111,7 +111,7 @@ builder += '; filename="' + filename + '"'; builder += crlf; - builder += 'Content-Type: application/octet-stream'; + builder += 'Content-Type: ' + mime; builder += crlf; builder += crlf; @@ -261,10 +261,11 @@ builder; newName = rename(file.name); + mime = file.type if (typeof newName === "string") { - builder = getBuilder(newName, e.target.result, boundary); + builder = getBuilder(newName, e.target.result, mime, boundary); } else { - builder = getBuilder(file.name, e.target.result, boundary); + builder = getBuilder(file.name, e.target.result, mime, boundary); } upload.index = index;