1
0
Fork 0

Unmodified files listing as modified even though they are not; commit to clear status.

This commit is contained in:
Andrew Tomaka 2011-11-05 12:58:23 -04:00
parent 39b13ab303
commit 28f664e6eb
3 changed files with 12 additions and 12 deletions

View File

@ -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',

View File

@ -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);

View File

@ -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;