Hi,
I want help in
Servlets....
My problem is, i am having one servlet and one client(Html) and one imageFile. My servlet knows the filePath, now it has to process the filePath so that the imageFile is displayed in Html. Now, the issue is in servlet is there any other procedure other than streaming the file in to ServletoutputStream??? I know that the following code solves my problem,
File f = new File("F:\\Images\\2\\3\\2004\\12282004\\08\\1.jpg");
byte[] imageData = new byte[(int) f.length()];
FileInputStream fis = new FileInputStream(f);
fis.read(imageData);
response.setContentType("image/jpeg");
ServletOutputStream out = response.getOutputStream();
out.write(imageData);
But what I want to know is, instead of Streaming the file into byteArray and set into ServletOutputStream, is there any other alternative???
Thanks in advance
Regards,
Rama Sarma Vemuri L S K
Mobile: +91-9885584568