I have written a page that will display/download files stored as blobs in a database. Everything seems to be working just fine, except for one thing. If the MIME-type requires a plug-in to display properly, it does not use the plug-in. It just prompts the user to download/open the file. If you download or open the file it will launch the viewer for the file type.
For example, instead of seeing a PDF file in IE or Netscape using the brower plugins, it will launch Adobe Acrobat Reader.
My question is this: How do I display a binary stream(blob) and have it use plugins when required?
My code is as follows:
<%
Response.Buffer = TRUE
Response.Clear
Response.ContentType = oDocument.MIME
Response.AddHeader "Content-Disposition","attachment;filename=Mypdf.pdf"
if oDocument.MIME = "text/html" or oDocument.MIME = "text/plain" then
Response.Write oDocument.DataStream
else
Response.BinaryWrite(oDocument.DataStream)
end if
Response.Flush
%>
Where oDocument is an object that contains the data.
Any help would be greatly appreciated.
For example, instead of seeing a PDF file in IE or Netscape using the brower plugins, it will launch Adobe Acrobat Reader.
My question is this: How do I display a binary stream(blob) and have it use plugins when required?
My code is as follows:
<%
Response.Buffer = TRUE
Response.Clear
Response.ContentType = oDocument.MIME
Response.AddHeader "Content-Disposition","attachment;filename=Mypdf.pdf"
if oDocument.MIME = "text/html" or oDocument.MIME = "text/plain" then
Response.Write oDocument.DataStream
else
Response.BinaryWrite(oDocument.DataStream)
end if
Response.Flush
%>
Where oDocument is an object that contains the data.
Any help would be greatly appreciated.