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
posted 13 years ago
ravik Welcome to the JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy. You can change it here. Thanks! and welcome to the JavaRanch!