• Post Reply Bookmark Topic Watch Topic
  • New Topic

image display quary: need help  RSS feed

 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends,

i have an signed japplet which is run using jsp. now i want to display image selected from clients local file system.

is it possible to display image in this signed japplet from clients file system without uploading that image?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, a signed applet has access to the client file system, and thus can open and display images.
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much for your kind of help

can i store image data in session attribute?

which of the two way will be more significant to use?

1) displaying image in applet without uploading it, or
2) displaying an uploaded image in applet retrieving it from server
[ November 26, 2007: Message edited by: Nidhi Nagre ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i store image data in session attribute?

Yes, but you said you didn't want to upload the image.

which of the two way will be more significant to use?

Not sure what you mean by "significant" - efficient?

Why would you want to upload the image if you're going to display it in the applet? It seems that uploading it would just cost extra time, extra effort, extra page loads etc. without any benefits.
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much one 2nd

i got my quary solved

one more question
how can i send back file data from servlet to applet before saving it into database using HttpClient just like HttpConnection two way circle?
what should i add Content-type for response, again multipart/form-data? or since it is present as binary data in inputstream hence it should it be
application/octet-steam?
should i add FileItem objects to outputstream directly?
please write couple of lines of code
[ November 26, 2007: Message edited by: Nidhi Nagre ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what should i add Content-type for response, again multipart/form-data? or since it is present as binary data in inputstream hence it should it be
application/octet-steam?
Multipart/form-data is for requests only; use application/octet-steam.

should i add FileItem objects to outputstream directly?

Just stream the binary file data, as you're getting it from the output stream of FileItem. But why would you need to send that data to the applet, if the applet has just uploaded it?
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mr Ulf wrote:
Just stream the binary file data, as you're getting it from the output stream of FileItem.


would please make it clearer one 2nd, moreover how can i open inputstream inside applet?


But why would you need to send that data to the applet, if the applet has just uploaded it?


i just wants to know how it is possible?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting confused now about what exactly you have now (where are images, and where are they being transferred to), and what are you still trying to implement. Maybe you can clarify that so we know how to help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!