Classic ASP and IIS 6.0

A

anon

The following code works on IIS 5.0 on a Windows 2000 server.

Response.Clear Response.ContentType = "application/rtf" Response.AddHeader
"content-disposition", "inline;filename=letter.rtf" response.write l_strBuffer

But on IIS 6.0 running on Windows 2003 server we get an error.
"Internet Explorer cannot download <file name>.
Interner Explorer was not able to open this Internet site. The site is
either unavailable or cannot be found. Please try again later."

After increasing the AspBufferLimit attribute in the metabase.xml, we were
able to resolve the issue.
Is there any other way to resolve this without modifying the metabase.xml ?
 
A

Anthony Jones

anon said:
The following code works on IIS 5.0 on a Windows 2000 server.

Response.Clear Response.ContentType = "application/rtf" Response.AddHeader
"content-disposition", "inline;filename=letter.rtf" response.write l_strBuffer

But on IIS 6.0 running on Windows 2003 server we get an error.
"Internet Explorer cannot download <file name>.
Interner Explorer was not able to open this Internet site. The site is
either unavailable or cannot be found. Please try again later."

After increasing the AspBufferLimit attribute in the metabase.xml, we were
able to resolve the issue.
Is there any other way to resolve this without modifying the metabase.xml ?


add

Response.Buffer = False
Response.ContentType = "application/rtf"
Response.CharSet = "Windows-1252" ' Set appropriate to codepage
Response.AddHeader "content-disposition", "inline;filename=letter.rtf"

Dim i
Const clChunkSize = 1048576
For i = 1 To Len(l_strBuffer) \ clChunkSize
Response.Write Mid(l_strBuffer, (i -1) * clChunkSize, clChunkSize)
Next

If (Len(lstrBuffer) Mod clChunkSize) <> 0 Then
Response.Write Mid(l_strBuffer, (i -1) * clChunkSize)
Next


The rtf content is dynamically generated?
 
A

anon

Anthony Jones said:
add

Response.Buffer = False
Response.ContentType = "application/rtf"
Response.CharSet = "Windows-1252" ' Set appropriate to codepage
Response.AddHeader "content-disposition", "inline;filename=letter.rtf"

Dim i
Const clChunkSize = 1048576
For i = 1 To Len(l_strBuffer) \ clChunkSize
Response.Write Mid(l_strBuffer, (i -1) * clChunkSize, clChunkSize)
Next

If (Len(lstrBuffer) Mod clChunkSize) <> 0 Then
Response.Write Mid(l_strBuffer, (i -1) * clChunkSize)
Next


The rtf content is dynamically generated?

Thanks you for the reply.
We have an rtf template. The bookmarks in the template are replaced and rtf
is spit out.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top