Why don't you just get a "byte array" of jpeg image data and then
write to the OutputStream you get out of the HttpServletResponse.
You don't need to write to a file in the server unless you want to.
Codewise, it would be something like this:
-------------------------------------------------------------
//res is HttpServletResponse object
//filename is thename you wannna give to the file
//if the user is prompted to save
res.setContentType("gif/jepg; name="+filename);
try{
OutputStream out = res.getOutputStream();
BufferedOutputStream bout = new BufferedOutputStream(out);
// here data is the "byte array" and
// "datalength" is the size of byetarray
bout.write(data, 0, datalength);
bout.close();
}catch( java.net.SocketException e ){
e.printStackTrace();
}catch( java.io.IOException e ){
e.printStackTrace();
}
--------------------------------------------------------------
Thanks
Pradeep
Pradeep Paudyal
Software Engineer,
Bricsnet US
Ph: 603 559 2505
On Fri, 12 Jan 2001, kishore wrote:
> Date: Fri, 12 Jan 2001 11:15:53 +0530
> From: kishore <[EMAIL PROTECTED]>
> Reply-To: A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology. <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Dynamic Imaging problem
>
> i am dealing with dynamic imaging project.i get raw data from client machine
> and create dynamic JPEG file.i do not want to create JPEG file because
> it
> writes into server hard disk.IS THERE ANY WAY TO SHOW A DYNAMIC
> IMAGE TOCLIENT WITHOUT WRITING ANY THING INTO SERVER HARD
> DISK.
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html