How to read a file content.
1 posts in topic
Flat View  Flat View

Posted By:   krishnakanth_Rengarajan
Posted On:   Friday, March 5, 2004 08:19 PM

hi all

Iam developing a JSP application which runs in Tomcat server.

My requirement is that end user will upload a file and my application should read first 10 lines of the file and show to the user in an applet, if the user feels he has choosen a right file then he uploads the file to the server by clicking a Upload button.

I want your help in reading the content of the file which was not uploaded to server through by JSP.

Thanking you in Advance


Re: How to read a file content.

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, March 6, 2004 12:15 PM

On the client side, I guess if you have a signed applet and the user has configured the browser with the right security policy, then it could be allowed to read the file there locally on the client. So the applet would do your 'read first 10 lines, display and prompt for whether to upload'.

The JSP wouldn't be invoked until and unless the user tells the applet to proceed with the upload, and the applet POST's the data to the URL for the JSP.

I suppose you could have the applet only upload the first 10 lines or whatever of the file, assuming you have it reading the local file in the first place.

About | Sitemap | Contact