Forums Register Login

FileUpload - Request empty with IE8

+Pie Number of slices to send: Send
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

+Pie Number of slices to send: Send
Can you show us the HTML code for both the form and the file input field?
+Pie Number of slices to send: Send
I have left out the CSS and some JavaScripts validation checks at the client to make it a bit shorter.
Thanks

+Pie Number of slices to send: Send
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

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
Paper jam tastes about as you would expect. Try some on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 4623 times.
Similar Threads
Submit multipart and form data
problem with fileUpload
Uploading file with special characters in name
upload.parseRequest(request); giving null.
JSP / Servlet upload images
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:02:39.