I am using same below code file upload:
working in Firefxo but not in IE. I am struck with this more than 30 hrs. Please somebody can look at this?
Code:
uploadSecuritiesPanel = new Ext.FormPanel({
fileUpload: true,
width: '30%',
frame: true,
title: 'Load Securities from file',
height: 180,
bodyStyle: 'padding: 10px 10px 0 10px;',
border: false,
labelWidth: 20,
defaults: {
anchor: '95%',
allowBlank: false,
msgTarget: 'side'
},
items: [{
xtype: 'fileuploadfield',
id: 'form-file',
emptyText: 'Upload securities file',
fieldLabel: 'File',
name: 'file-path',
width: 100,
buttonText: '',
buttonCfg: {
iconCls: 'upload-icon'
}
}
],
buttons: [{
text: 'Load securities from file',
handler: function(){
if(uploadSecuritiesPanel.getForm().isValid()){
uploadSecuritiesPanel.getForm().submit({
url: 'CvgDispatcher?action=UPLOAD_SECURITIES',
waitMsg: 'Uploading your file...',
success: function(fp, o){
msg('Success', 'Processed file "'+o.result.result+'" on the server');
}
});
}
}
},{
text: 'Reset',
handler: function(){
uploadSecuritiesPanel.getForm().reset();
}
}]
});
servlet code:
Code:
int processed = 0;
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List<FileItem> fileItemsList = upload.parseRequest(request);
for (FileItem fileItem : fileItemsList) {
processed++;
}
printWriter.print("{success:true, result:'"+ processed +"'}");
In Firefox I am getting 1 as processed but in IE I am getting 0.
Thanks.