Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How image stored in database could be displayed
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sunita Mittal  
View profile  
 More options Jun 7 2007, 1:01 am
From: "Sunita Mittal" <sunita.mit...@daffodildb.com>
Date: Thu, 7 Jun 2007 10:31:28 +0530
Local: Thurs, Jun 7 2007 1:01 am
Subject: How image stored in database could be displayed

Hello,

     Currently the way we can make image is using the url and loading the
image from defined url.

     But suppose , if I have a image stored in database and want to send the
byte[] to client and show the image by making a temp file at client side.
How it can be achived.

    Or any other way We can manage showing image stored in database (i.e.
binary or BLOB data).

Thanks
Sunita Mittal.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
George Georgovassilis  
View profile  
 More options Jun 7 2007, 3:58 am
From: George Georgovassilis <g.georgovassi...@gmail.com>
Date: Thu, 07 Jun 2007 00:58:38 -0700
Local: Thurs, Jun 7 2007 3:58 am
Subject: Re: How image stored in database could be displayed
While this has nothing to do with GWT, here is a link [1] to an
example of a servlet that can stream images from a file - the file is
the byte[] source and it's then written to the request. You'd probably
only change the source, that is get the byte[] from querying a
database.

[1] http://www.experts-exchange.com/Programming/Languages/Java/J2EE/JSP/Q...

On Jun 7, 8:01 am, "Sunita Mittal" <sunita.mit...@daffodildb.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ibmurai  
View profile  
 More options Jun 7 2007, 4:26 am
From: Ibmurai <j...@dansupport.dk>
Date: Thu, 07 Jun 2007 01:26:02 -0700
Local: Thurs, Jun 7 2007 4:26 am
Subject: Re: How image stored in database could be displayed
An easy way to accomplish this is to make a php file which sets the
headers and such...
Then you call the php file with an image id or whatever and it returns
the image you want....
Example:
Image = new Image("www.somepage.com/image.php?id=42");

I'm sure there's lots of examples out there on how to make the php
file - it's easy though... In my project I've done it with files in
general - looks like this:

<?php
if (isset($_REQUEST['file_id'])) {
        $file = new File($con, $_REQUEST['file_id']);
        header("Cache-Control: public, must-revalidate");
        header("Pragma: hack");
        header("Expires: 0");
        header("Content-Type: " . $file->getMime());
        header("Content-Length: " . $file->getSize());
        header("Content-Disposition: attachment; filename=\"" . $file-

>getName()."\"");

        header("Content-Transfer-Encoding: binary");
        echo $file->getBlob();
        exit;
}

echo "File not found!";
?>

As you can see I use a homebrew File class to contain the database
information, but that's not needed.

BE AWARE that IE relies heavily on the order of the headers, so use
the order I've used, and all will be fine :)

On Jun 7, 9:58 am, George Georgovassilis <g.georgovassi...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mP  
View profile  
 More options Jun 7 2007, 6:56 am
From: mP <miroslav.poko...@gmail.com>
Date: Thu, 07 Jun 2007 10:56:57 -0000
Local: Thurs, Jun 7 2007 6:56 am
Subject: Re: How image stored in database could be displayed
It is not possible to create an image on the client from an array of
bytes. Most browsers ( pretty much all except IE ) can create an image
from a String. THe string must be a url that includes the a "data:"
protocol followed by the image base64 encoded. You could source this
String from a RPC. Your RPC could return a bunch of objects that
includes the base64 encoded String as a property. For IE rather than
the base64 image you would need a url which includes an identifier
back to the server which would then feed the image.

ANother possibility is to send back the base64 image to *all* browsers
including IE. For iE your browser would make a request back to the
server with the base64 data in the url. The server would decode the
base64 data and send it back to IE which would show your image as
normal. Its a bit silly as the data gets downlaoded twice and uploaded
once.

hth

On Jun 7, 3:01 pm, "Sunita Mittal" <sunita.mit...@daffodildb.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google