Error working with Doc files

T

tfs

I have loaded my .doc files (word documents) into my Sql 2000 server.

I am trying to read and display the doc files in my ASP page.

The error I get is

Internet Explorer cannot download QATest.aspx from server.

Internet Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be found. Please try
again later.


MS has a KB about this (316431) and they talk about an SSL and Cache
problem. I looked at IIS and can't seem to see anything on SSL
there.

The problem is that if I take out the line:

response.ContentType = "application/msword"

It works fine. The data is displayed as raw text, but the data is
there. The error happens on that line. Not sure why it is having
problem loading the aspx page.

[code:1:d1f6601f2d]
<%@ Page Language="VB" ContentType="text/html"
trace="true" ResponseEncoding="iso-8859-1" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>Temp display</title>
<script runat="server">

Sub Page_Load(sender as Object, e as EventArgs)

Dim sResults As String

Dim ConnectionString as String
=System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Contour_Server")
Dim objConn as New SqlConnection (ConnectionString)
Dim CommandText as String = "select document from
openworx..qadocs"
Dim objCmd as New SqlCommand(CommandText,objConn)
objConn.Open()

Dim objCommand as SqlCommand = new SqlCommand(CommandText,
objConn)
Dim objDataReader as SqlDataReader = objCommand.ExecuteReader( _
CommandBehavior.CloseConnection)

dim ktr as integer

Dim arrByteData As Byte()

while (objDataReader.Read() = true)
if(objDataReader(0) is System.DBNull.value) then
exit while
else
arrByteData =
Ctype(objDataReader(0),Byte())
response.ContentType = "application/msword"
response.BinaryWrite(arrByteData)
end if
end while
End Sub
</script>

</head>
<body>

</body>
</html>
[/code:1:d1f6601f2d]

Anyone know how I can solve this problem?

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top