Hello,
I am uploading an attachment file to a server and am displaying these attachments as font icons in a data view below the fileuploadfield buttons. The entire process works perfect using Chrome and FireFox, but not in IE...
In IE, the form gets submitted and this can be verified on the server side. The server gives it an id number, trims out the path and leaves the file name. On success, my code gets the action.result and adds a new attachment to the store. As I said, this is fine in Chrome and FF, but in IE it fails and the form and action arguments are undefined. The strange thing is I get a dialog box from IE asking me if I want to save or open the JSON response, and the response is just as it should be.
Ive searched and found people with similar issues, but their solutions have not worked, so any help would be appreciated greatly.
Heres my code:
Code:
uploadValidAttachment: function(btn, value){
var me = this;
var form = btn.up('form').getForm();
var submitUrl = this.getViewModel().get('baseUrl') + '/uploadFiles';
if(form.isValid()){
Ext.toast('valid');
debugger;
form.submit({
url : submitUrl,
headers : {'Content-Type':'multipart/form-data'},
waitMsg : 'Uploading your document...',
method : 'POST',
success : function(form, action){
debugger;
Ext.toast('upload complete');
var response = action.result, docModel = me.getViewModel().get('doc');
var attachment = new RA.model.Attachment({
id : response.data.fileContent.contentId,
name : response.data.fileContent.fileName,
mimeType : response.data.fileContent.mimeType,
attachmentType : response.data.fileContent.contentType,
});
me.getViewModel().get('doc').addAttachment(attachment);
Ext.toast('adding attachment to store');
},
failure : function(form, action){
debugger;
var response = action.result;
Ext.MessageBox.alert("Error", Ext.encode(this.response.responseText).message);
},
});
}
},