Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileUpload - Request empty with IE8

 
Peter Basil
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using the Commons FileUpload package to upload a file to the server.

I have executed my Servlet with Firefox, Chrome and Safari without any problem.
But when I try with IE8, it fails as the request does not seems to contain the data and upload.parseRequest(request) returns and empty List.
I wonder whether I am missing anything.

This is my code:

I am running on apache-tomcat-7.0.27 and the libraries I am using are: commons-fileupload-1.2.2.jar, commons-io-2.1.jar

Many thanks in advance,
Peter

 
Rob Spoor
Sheriff
Pie
Posts: 20510
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the HTML code for both the form and the file input field?
 
Peter Basil
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have left out the CSS and some JavaScripts validation checks at the client to make it a bit shorter.
Thanks

 
kiran badi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it does not work in IE and works on other browsers, then probably you need to use F12 Developer tool of IE and see how does the request look like in IE.

The way IE reads path info is quite different than ff/chrome.
I recently implemented apache file upload and has 7.0.27 TC and its working fine for me.Atleast till now

 
Peter Basil
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kiran, when debugging JAVA I can already see that no field is actually being sent in the request object.
The Iterator in line 20 of the servlet is empty as parseRequest(req) does not find any field.

However I am not able to guess what is wrong with my HTML for IE8 not to send the fields through
 
Peter Basil
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is an issue with the HTML encoding as no parameter is being send via POST.
Kiran, do you still have a sample of this HTML so I can have a look? Thanks
 
kiran badi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I been years I have done scriplets and development though now a days I spending hell lot of timeIdeall figuring things out myself.

you are using button type submit which is different than regular input type submit.Form elements works differently.Can you try changing button type submit as form type submit.

<input type ="submit"> this one fires event which gets attached to action element. and button type="submit" means you need to attach onclick event to this.

I am surprised its working in other browsers for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic