A pdf embedded in a table cell? Unfortunately that won't work. The adobe plugin must be selfcontained in it's own page. You are going to have to omit any html code for this approach to work. Unless you are putting images in the cells. To get this to work I did the following<BR><BR>setup a pae celled getFile.asp say. This file needs info like picture id to get correct record from db. eg<BR>getFile.asp?id=1<BR><BR>then n getFile.asp do<BR>Response.ContenType=Response.ContentType = rs("Content Type")<BR>Response.BinaryWrite rs("File Data")<BR><BR>and in another asp page do<BR><BR><img src=getFile.asp?ID=1"><BR><BR>should work fine. This is a good way of securing all file types from curious eyes as could use adostream object to read files from harddrive outside web folders (use db to store address of files) then use this binary write to display. Can incorporate security checks to see if eligible to view files.
Hello...I am trying to display images stored in an Access DB. I guess I am not smart enough to follow your code, but I feel you are doing exactly what I want to do. All I want to do is display the image using response.binaryWrite in a table cell. But I found out that after I use Response.ContentType....I can not use any HTML tags.<BR><BR>Would you be kind enough to detail your solution a little bit more? <BR><BR>I really do appreciate any help I can get.
Ok You're going to need 2 pages to accomplish what you want<BR><BR>Page1.asp - displays the table with images in it <BR>Page2.asp - actually retrieves the image from the db and binary writes it out.<BR><BR>Page1.asp ('assume need to loop through recordset to display all images of a certain type)<BR><BR>'some db code to get id's of images in a recordset<BR>''simplified table code images all in one row<BR><table><BR><tr><BR> 0;%Do while not rs.eof%><BR><td><img src="page2.asp?<%=rs("id")%>">< ;/td><BR><%Rs.MoveNext<BR> Loop%><BR></tr><BR></table><BR><BR><BR>Page2.asp<BR><%<BR>Res ponse.Buffer = True<BR>Dim strID, strSQL<BR>strID = Request("ID")<BR><BR>strSQL = "Select * From Table Where ID=" & strID<BR>'rest of code to get recordset data for the image<BR><BR>Response.ContentType = rs("contentType") 'assume contentype in record in field contenType<BR>Response.BinaryWrite rs("FileData")<BR><BR>'rs.Close<BR>'res t of clean upr<BR>response.End<BR>%><BR><BR><BR><BR>Only thing is I have never written image data stored in a db out like that. In my system i store the images in a dir outside the web then store path + filename in a table instead of data then use following code to read data and write back to browser:<BR><BR>Dim objStream <BR>Set objStream = Server.CreateObject("ADODB.Stream")<BR>objStream.T ype = 1 'Set to Binary Data<BR>objStream.Open<BR>objStream.LoadFromFile rs("FullFilePath")<BR>Response.ContentType = rs("ContentType")<BR>Response.BinaryWrite objStream.Read<BR>objStream.Close<BR>set ObjStream = Nothing<BR><BR>This keeps database smaller and easier to manage files with ftp software + some db admin pages.<BR><BR><BR>