Once this form is submitted, control goes to servlet, which does some manipulation and calls a java program passing the input stream.
In that java program, i try to read the file thus uploaded using the inputstream. It says file not found.
Is there any possibility of the stream getting lost at the point when i try to open the uploaded file?
Note: I am trying to upload an excel file and open the same, using jexcel api. When i call that last java program from a jsp it is working fine. When i changed my program flow and added a servlet, it is not working now.
You'd be much better off using an upload library. We list some in the FileUpload FAQ
If, for some reason, you really want to implement this yourself, you'll want to keep in mind that you can either call getInputStream OR one of the methods that return parameters but not both. Once you call one of the latter methods, the servlet parses the input stream to get the parameters. Once parsed, it's no longer available to the getInputStream method.