Index: /trunk/library/ckeditor/plugins/expresso/plugin.js
===================================================================
--- /trunk/library/ckeditor/plugins/expresso/plugin.js	(revision 5984)
+++ /trunk/library/ckeditor/plugins/expresso/plugin.js	(revision 6073)
@@ -99,14 +99,33 @@
 });
 function bindFileUpload(e) {
-        var ID = currentTab;
-        var newImageId = new Date().getTime();
-        var fileUploadIMG = $('#fileupload_img'+ID);
-        var fileUploadMSG = $('#fileupload_msg'+ID);
-        var maxAttachmentSise = (preferences.max_attachment_size !== "" && preferences.max_attachment_size != 0) ? (parseInt(preferences.max_attachment_size.replace('M', '')) * 1048576 ) : false;
+	var ID = currentTab;
+	var newImageId = new Date().getTime();
+	var fileUploadIMG = $('#fileupload_img'+ID);
+	var fileUploadMSG = $('#fileupload_msg'+ID);
+	var maxAttachmentSize = (preferences.max_attachment_size !== "" && preferences.max_attachment_size != 0) ? (parseInt(preferences.max_attachment_size.replace('M', '')) * 1048576 ) : false;
 	fileUploadIMG.fileupload({
-		sequentialUploads: true,
+		type: 'post',
+		dataType : 'json',
+		url: "../prototype/post.php",
+		forceIframeTransport: true,
+		formData: function(form) {
+			return [
+				{
+					name : "mailAttachment[0][source]",
+					value : "files0"
+				},
+				{
+					name : "mailAttachment[0][disposition]",
+					value : $('#attDisposition'+ID).val()
+				},
+				{
+					name: "MAX_FILE_SIZE",
+					value : maxAttachmentSize
+				}
+			];
+		},
 		add: function (e, data) {
      
-			if(!maxAttachmentSise || data.files[0].size < maxAttachmentSise) {
+			if(!maxAttachmentSize || data.files[0].size < maxAttachmentSize) {
 				setTimeout(function() {
                                         $('#attDisposition'+ID).val('embedded');
@@ -124,10 +143,10 @@
 					attach.fileName = file.name.substr(0, 18) + "..." + file.name.substr(file.name.length-9, file.name.length);
 				attach.fileSize = formatBytes(file.size);
-				if(maxAttachmentSise && file.size > maxAttachmentSise)
+				if(maxAttachmentSize && file.size > maxAttachmentSize)
 					attach.error = 'Tamanho de arquivo nao permitido!!'
 								
 				fileUploadMSG.find('.attachments-list').append(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
 
-				if(!maxAttachmentSise || file.size < maxAttachmentSise){
+				if(!maxAttachmentSize || file.size < maxAttachmentSize){
 					fileUploadMSG.find(' .fileinput-button.new').append(data.fileInput[0]).removeClass('new');
 					fileUploadMSG.find(' .attachments-list').find('[type=file]').addClass('hidden');
@@ -168,22 +187,21 @@
 		done: function(e, data){
 			if(!!data.result && data.result != "[]"){
-				var newAttach = jQuery.parseJSON(data.result);
-                                
-                                //Compatibilidade com Firefox3.6
-                                    if(newAttach === null ) newAttach = jQuery.parseJSON(data.result.text());
-                                
-                                if(newAttach.rollback !== false)
-                                {
-                                    fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>').find('.status-upload').addClass('ui-icon ui-icon-check');
-                                    addAttachment(ID,newAttach['mailAttachment'][0][0].id);
-                                    var content_body  = RichTextEditor.getData('body_'+ID);
-                                    var rex = new RegExp('<img id="'+newImageId+'" src="" [^\/>]*\/>', 'i'); 
-                                    var newImg = '<img src="../prototype/getArchive.php?mailAttachment='+newAttach['mailAttachment'][0][0].id+'" />'; 
-                                    content_body = content_body.replace(rex,newImg); 
-                                    RichTextEditor.setData('body_'+ID,content_body); 
-                                }
-                                else
-                                    fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');   
-      
+				var newAttach = data.result;
+				if(!newAttach.mailAttachment.error){
+					if(newAttach.rollback !== false)
+					{
+						fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>').find('.status-upload').addClass('ui-icon ui-icon-check');
+						addAttachment(ID,newAttach['mailAttachment'][0][0].id);
+						var content_body  = RichTextEditor.getData('body_'+ID);
+						var rex = new RegExp('<img id="'+newImageId+'" src="" [^\/>]*\/>', 'i'); 
+						var newImg = '<img src="../prototype/getArchive.php?mailAttachment='+newAttach['mailAttachment'][0][0].id+'" />'; 
+						content_body = content_body.replace(rex,newImg); 
+						RichTextEditor.setData('body_'+ID,content_body); 
+					}
+					else
+						fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');   
+				}else{
+					fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append(newAttach.mailAttachment.error).addClass('message-attach-error');   
+				}
 			}else {
                                     fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');   
