I am trying to write an application that allows users to upload Word docs to an Oracle BLOB field and view them back later. I have worked out the load part but am running into difficulty with the view it back part. I have read and tried the code in thread333-908477 but haven't had any luck. My code looks like this:
<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Buffer = True
Response.Clear
Response.ContentType = "application/msword"
Response.AddHeader "Content-Disposition", "filename=temp.doc"
Dim id
Dim Conn
Dim RS
set Conn = server.createObject("adodb.connection")
Conn.open "Provider=OraOLEDB.Oracle;Data Source=****;User ID=****;PASSWORD=****;Persist Security Info=True"
set RS = server.createObject("adodb.recordset")
ID = 1
set rs = conn.execute("SELECT Document FROM Documents WHERE DocumentID = " & ID)
If not rs.EOF or not rs.BOF Then
response.binaryWrite rs.fields("Document").value
End If
response.flush
response.end
%>
(bear in mind this is test code). It connects to the database and extracts the BLOB information but it comes out like:
ÐÏࡱá>þÿ WYþÿÿÿTUVÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿì¥Áq ¿F bjbjt+t+ AA£ÿÿÿÿÿÿ]ÖÖÖÖÖÖÖêêêêêþê¶&¦ÌÌÌÌÌ–b\¾0°²²²²²²$¹ôVÖ-ÖîÌÌîîÖòÖÖÌÌ&òòòî‚ÖÌÖÌ°êêÖÖÖÖî°ò¾ò°ÖÖ°Ì Àzæ5SPÂêêp‚° REQUEST FOR WAIVER OF COMPETITIVE BIDS REQUEST DATE FORMTEXT WORK/MATERIAL DESCRIPTION FORMTEXT WE REQUEST THAT COMPETITIVE BIDS FOR THIS WORK BE WAIVED BASED UPON THE FOLLOWING: 1. FORMCHECKBOX
... (More of the same) ...
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ ÀF€Î¾5SPÂ`Õ6SPÂZ€Data ÿÿÿÿÿÿÿÿÿÿÿÿ E^1Tableÿÿÿÿÿÿÿÿ<WordDocumentÿÿÿÿSummaryInformation(ÿÿÿÿÿÿÿÿÿÿÿÿDDocumentSummaryInformation8ÿÿÿÿÿÿÿÿL`Õ6 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿþÿ ÿÿÿÿ ÀFMicrosoft Word Document MSWordDocWord.Document.8ô9²q
Does anyone have any idea how I can actually view the file as a Word Doc?
Thank you in advance for your help.
BAKEMAN
<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Buffer = True
Response.Clear
Response.ContentType = "application/msword"
Response.AddHeader "Content-Disposition", "filename=temp.doc"
Dim id
Dim Conn
Dim RS
set Conn = server.createObject("adodb.connection")
Conn.open "Provider=OraOLEDB.Oracle;Data Source=****;User ID=****;PASSWORD=****;Persist Security Info=True"
set RS = server.createObject("adodb.recordset")
ID = 1
set rs = conn.execute("SELECT Document FROM Documents WHERE DocumentID = " & ID)
If not rs.EOF or not rs.BOF Then
response.binaryWrite rs.fields("Document").value
End If
response.flush
response.end
%>
(bear in mind this is test code). It connects to the database and extracts the BLOB information but it comes out like:
ÐÏࡱá>þÿ WYþÿÿÿTUVÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿì¥Áq ¿F bjbjt+t+ AA£ÿÿÿÿÿÿ]ÖÖÖÖÖÖÖêêêêêþê¶&¦ÌÌÌÌÌ–b\¾0°²²²²²²$¹ôVÖ-ÖîÌÌîîÖòÖÖÌÌ&òòòî‚ÖÌÖÌ°êêÖÖÖÖî°ò¾ò°ÖÖ°Ì Àzæ5SPÂêêp‚° REQUEST FOR WAIVER OF COMPETITIVE BIDS REQUEST DATE FORMTEXT WORK/MATERIAL DESCRIPTION FORMTEXT WE REQUEST THAT COMPETITIVE BIDS FOR THIS WORK BE WAIVED BASED UPON THE FOLLOWING: 1. FORMCHECKBOX
... (More of the same) ...
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ ÀF€Î¾5SPÂ`Õ6SPÂZ€Data ÿÿÿÿÿÿÿÿÿÿÿÿ E^1Tableÿÿÿÿÿÿÿÿ<WordDocumentÿÿÿÿSummaryInformation(ÿÿÿÿÿÿÿÿÿÿÿÿDDocumentSummaryInformation8ÿÿÿÿÿÿÿÿL`Õ6 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿþÿ ÿÿÿÿ ÀFMicrosoft Word Document MSWordDocWord.Document.8ô9²q
Does anyone have any idea how I can actually view the file as a Word Doc?
Thank you in advance for your help.
BAKEMAN