File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes unable to upload more than 5MB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "unable to upload more than 5MB" Watch "unable to upload more than 5MB" New topic

unable to upload more than 5MB

chandrakanth boga
Ranch Hand

Joined: Mar 15, 2006
Posts: 49
HI ,

I need to upload product brochure file through ADMIN TOOL.
When i upload a file upto 4 MB it is working fine.
But when i upload more than 4.5 MB it is giving error in the page :--
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
I tried to check the LOG FILES.It is not throwing any exception on the CONSOLE.
I checked the code.In the jsp it is calling a function to check the size of the file.The size limit is 500MB.So we can upload a file size upto 500MB.
But still it is not taking more than 5 MB.

Could any one help regarding the problem..............
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
It's quite strange. I can upload over 4GB. Actually I met a silly error when I tried to upload more 4GB due int limitation but switching to long fixed the problem.

Tough in space?, <a href="" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="" target="_blank" rel="nofollow">Check it here.</a><br /><a href="" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
parra matta
Ranch Hand

Joined: Mar 23, 2006
Posts: 40
Try to use encoding of multipart/form-data instead of application/x-www-form-urlencoded.

multipart/form-data should be used to upload files.

There is not a built-in library of J2ee to support multipart/form-data, but there are many on the net. Try this one:
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

"Autumn Sky",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JavaRanch Sheriff

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: unable to upload more than 5MB
It's not a secret anymore!