|
 |
asp_web_howto thread: Showing Pictures stored in a database
Message #1 by "Chip Dukes" <cdukes77@b...> on Sun, 24 Feb 2002 00:15:34 -0500
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0184_01C1BCC8.60FBA470
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
I have an Access database with pictures stored in it as OLE packages ...
how can I display these in a web page ... my ASP page works just fine
until I insert the field for the photo - at which time I get a type
mismatch error.
Response.Write (objRS("MemberID") & "<br>" & objRS("Photo"))
Message #2 by "TomMallard" <mallard@s...> on Sun, 24 Feb 2002 09:49:08 -0800
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0015_01C1BD18.81478FA0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
This is why people usually do not store the actual graphic in the database
for web applications and typically store the path to them as files.
The client will need a downloadable component that can display the OLE
package as is, or can interpret a binary transfer of the image.
tom mallard
seattle
----- Original Message-----
From: Chip Dukes [mailto:cdukes77@b...]
Sent: Saturday, February 23, 2002 9:16 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Showing Pictures stored in a database
I have an Access database with pictures stored in it as OLE packages ...
how can I display these in a web page ... my ASP page works just fine until
I insert the field for the photo - at which time I get a type mismatch
error.
Response.Write (objRS("MemberID") & "<br>" & objRS("Photo")) ---
$subst('Email.Unsub').
Message #3 by "Ken Schaefer" <ken@a...> on Mon, 25 Feb 2002 10:24:18 +1100
|
|
Think about how a normal webpage works.
You have HTML, then you have <img src="/somefile.gif"> ie, the images are in
*separate* files which need to be downloaded by the browser separately.
You can not have a HTML page which you also put an image file data into.
What you need to do is something like:
(in your HTML page):
<img src="/getimage.asp?ID=5">
and then getimage.asp extracts the binary data from the Access database,
sets the appropariate Response.ContentType (eg image/gif), and then
Respones.BinaryWrite() the data to the browser.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chip Dukes" <cdukes77@b...>
Subject: [asp_web_howto] Showing Pictures stored in a database
I have an Access database with pictures stored in it as OLE packages ... how
can I display these in a web page ... my ASP page works just fine until I
insert the field for the photo - at which time I get a type mismatch error.
Response.Write (objRS("MemberID") & "<br>" & objRS("Photo"))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #4 by "DrClean" <wayne@D...> on Mon, 25 Feb 2002 09:00:05 -0000
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0003_01C1BDDA.D1288B60
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Hi Chip,
Why not rethink your database and instead of storing the pictures store the
location as in "My Documents/naughtypic.jpg". Then all you'll have to do is
write the code and direct the html to the code such as <img src="<%
rsImg('ImageSrc') %>">. This will work and not use extra storage in the
database.
Wayne
DrClean
www.DrClean.co.uk
The Best Cleaning Resource on the Web
-----Original Message-----
From: Chip Dukes [mailto:cdukes77@b...]
Sent: 24 February 2002 05:16
To: ASP Web HowTo
Subject: [asp_web_howto] Showing Pictures stored in a database
I have an Access database with pictures stored in it as OLE packages ...
how can I display these in a web page ... my ASP page works just fine until
I insert the field for the photo - at which time I get a type mismatch
error.
Response.Write (objRS("MemberID") & "<br>" & objRS("Photo")) ---
$subst('Email.Unsub').
|
|
 |