PDA

View Full Version : File Upload Not working in IE 8



kumarr.navin
10 Oct 2010, 9:05 PM
hi guys,

i have used FileUploadField.js to implement file uploading concept in my application.
the file upload is working well in FireFox/Mozilla, but with the IE 8 the concept is not working well.

here is the code i have used in my JS.

xtype : 'form',
bodyStyle : 'padding:25px',
width : 890,
layout : 'column',
url : 'userImage.action',
enctype : 'multipart/form-data',
encoding : 'multipart/form-data',
method : 'POST',
fileUpload : true,
height : 240,
id : 'picPanel',
items : [{
xtype : 'box',
anchor : '',
isFormField: true,
width : 300,
height : 300,
fieldLabel : 'Image',
autoEl : {tag : 'div',
html: '<img id="orgPic" height="50%" width="50%" src="' + Ext.BLANK_IMAGE_URL + '" class="img-contact" />'
}
},{
columnWidth : .65,
layout : 'form',
labelAlign : 'top',
border : false,
items: [{
xtype : 'fileuploadfield',
anchor : '100%',
fieldLabel : 'JPG or GIF',
name : 'userImage',
id : 'userImage'
},{
xtype : 'button',
text : 'Upload Picture',
handler : this.submitForm
}]
}]


any solution/ any other way of implementing the file upload will be a great help.

thanks in advance.

navin

Condor
10 Oct 2010, 10:35 PM
1. I assume you are using Ext 3? Then why did you specify isFormField:true in the image?
2. What exactly isn't working? Did you debug the request (e.g. using Fiddler2)?

andrejlnnk
10 Oct 2010, 11:44 PM
not work on the first or on the second time?

http://www.sencha.com/forum/showthread.php?111952-Fileupload-does-not-work-the-second-time

kumarr.navin
11 Oct 2010, 12:58 AM
hi condor,

i have removed the isFormField:true and tested. but still not working.
i am getting the fallowing error.

Syntax error
ext-all-debug.js line 12242.

Note: i am using struts for the action class.

thanks
navin

kumarr.navin
11 Oct 2010, 1:00 AM
hi andrejlnnk,

its not working at any time.
i am using struts for the same.

is there any thing i need to configure for the same.

thanks
navin

Condor
11 Oct 2010, 1:04 AM
Is your server returning the JSON response in the correct format (read the Ext.form.BasicForm API docs)?

kumarr.navin
11 Oct 2010, 1:29 AM
not even firing the action class method. if it was firing i can check for the jason object.

but the case is different. (firefox eveything works perfectly.)

thanks
navin

Animal
11 Oct 2010, 1:42 AM
I'd bet you have a trailing comma somewhere.

JSLint your code.

Condor
11 Oct 2010, 1:50 AM
JSLint your code.

And your JSON response too.