aspose file tools*
The moose likes Other Open Source Projects and the fly likes FileUpload - Request empty with IE8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "FileUpload - Request empty with IE8" Watch "FileUpload - Request empty with IE8" New topic
Author

FileUpload - Request empty with IE8

Peter Basil
Greenhorn

Joined: May 28, 2012
Posts: 4
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

Joined: Oct 27, 2005
Posts: 19544
    
  16

Can you show us the HTML code for both the form and the file input field?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Peter Basil
Greenhorn

Joined: May 28, 2012
Posts: 4
I have left out the CSS and some JavaScripts validation checks at the client to make it a bit shorter.
Thanks

kiran badi
Greenhorn

Joined: Oct 26, 2009
Posts: 26
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

Joined: May 28, 2012
Posts: 4
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

Joined: May 28, 2012
Posts: 4
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

Joined: Oct 26, 2009
Posts: 26
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileUpload - Request empty with IE8
 
Similar Threads
Uploading file with special characters in name
JSP / Servlet upload images
upload.parseRequest(request); giving null.
problem with fileUpload
Submit multipart and form data