File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes File upload fails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "File upload fails" Watch "File upload fails" New topic

File upload fails

Joly Mathew

Joined: Jul 03, 2002
Posts: 13
Hi all,
We have developed an upload module , which helps the user to upload
MP3 files to the server.
Module contains two parts 1. is the the servlet deployed in WAS 3.5.5 which reads the Httprequest and parse it and save the file to a temporary directory.
At the Client end we got a JSP file containing HTML form with 'file' input type and enctype set to 'multipart/form'.

Everything works fine when the entire setup is in intranet.

But when I try to upload the file to our production server which is in Internet, files are not uploading , infact I recieve , 'page cannot be displayed error' after sometime.

Just to isolate the issue I tried the O'reilly upload component in the same setup , but got the same error. further I emptied the parsing code in servlet and deployed it with a one system.out.printl statement. But again when I tried to call the servlet using the same HTML form, it comes with the same error .

I found that files with very small size (uptp 100KB) are getting uploaded .

Could any one advice us , what is going wrong with the component/network/server setup?

Thanks & Regards,
Joly Mathew
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
Check with your network admin is there any firewall or proxy server and if yes the settings.
Chandra Sekhar
Ranch Hand

Joined: Sep 26, 2003
Posts: 90

While using the Orielly componet i had similar kind of problem...

Now i'm using the constructor which specifies the maximum size for the upload..this fixed my issue with upload of small files(< 500kb)..

Still I dont know how do some validations at the client side if user selects to upload a file of very large size..

Try this...

Chandrasekhar S.

"Luck is when opportunity meets preparation"
I agree. Here's the link:
subject: File upload fails
It's not a secret anymore!