This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all, I have a file uploading servlet. In that I need to limit the file size to 1MB. I can get the file size at the beginning using request.getContentLength(). Now I need to send output message to the client using the response.getWriter().println(message); This command is getting executed, but the servlet is not sending the response until I read the whole file in the request body. I need to avoid unnecessarily reading a large file. Is there a way to send a message to the client form the servlet initially without reading the whole uploaded file ? I tried the 'Orielly' package also. THat is also having the same problem. The 'jspsmart' sample program works but it seems that they are also reading the whole uploaded file before giving the error message. Even Hotmail uploads the whole file blindly before giving the error message BUT somehow yahoo mail does it. It give the file too large error very quickly without reading the whole file. SO there has to be a way. Can anyone PLEASE help me Thanks a lot Ravi