Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

image in binary  RSS feed

 
Dhanashree Mankar
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone tell me what should i do to get the image in binary format
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From where do you want to read the image? From File or From Database?
 
Dhanashree Mankar
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to pass a binary form of image from servlet to user Image is already stored on server
Originally posted by Ali Gohar:
From where do you want to read the image? From File or From Database?
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still not understood
do you want to read the image file in form of byte[]?
 
Dhanashree Mankar
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Gohar:
Still not understood
do you want to read the image file in form of byte[]?

I want to convert the image in binary form i.e 10101 And need to send it in file
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But 'binary format' usually implies it already encoded as an image, which can be stored as file. You need to specify what the source of this 'binary data' is, and what the destination format is.
For example, if the image is stored on the harddrive of the server and you want to send it to the client, get a binary OutputStream from the request, set the mimeType to "image/imagetype" (eg image/jpeg), and pipe one to the other.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!