[1] http://www.experts-exchange.com/Programming/Languages/Java/J2EE/JSP/Q_21986929.html
On Jun 7, 8:01 am, "Sunita Mittal" <sunita.mit...@daffodildb.com>
wrote:
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:
> 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:
>
>
>
> > 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.- Hide quoted text -
>
> - Show quoted text -
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: