Displaying Binay data from Access2000 (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


Guest -> Displaying Binay data from Access2000 (3/20/2001 20:02:00)

Spooky,
Your page "Databases > Advanced Parameters" says "(BLOBS - Binary large objects) are NOT supported.
If you have existing imaged in your database of this type, you will not be able to display them."
Please tell me this is not so. I have spent a many hours trying to get my uploaded photos in to the database as binary data. Yes I should have looked at how to display the photos but I didn't think it would be a problem. I read an article once on displaying binary data but I can't remember if that pertained to SQL. Now I'm in trouble with the deadline and I can't find the article. Any advice?
Richard




Guest -> RE: Displaying Binay data from Access2000 (3/20/2001 20:26:00)

Ok I found this but I'm still a little confused.

Put a regular <IMG> tag on your HTML page with the SRC attribute pointing to an ASP script, e.g.
<IMG SRC="GetImage.asp?id=4">
The GetImage.asp script may look like this:
<%
Set db = Server.CreateObject("ADODB.Connection")
db.Open "data"
Set rs =db.Execute("SELECT BigBlob FROM Blobs where id = " & Request("id") )
Response.ContentType = "image/jpeg" '(or "image/gif")

This is where I get lost. What is Content Disposition and how am I to know the Content Length? Can you explain this to me?

' let the browser know the file name
Response.AddHeader "Content-Disposition", "filename=yourfile.ext"
' let the browser know the file size
Response.AddHeader "Content-Length", "545645"
Response.BinaryWrite rs("BigBlob")
%>





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625