Hi there
VB.NET Web app
Using a 'viewing page' I can pull a pdf file from the DB on the Development W/Station, but on the server it displays a blank page... As images are also stored in the same DB and relative directory, and are no problem, the issue can't be down to a path!
Here is the code
The server is W2K as is the workstation and both are running .NET 2.0 Framework.
Any ideas where to look?
Thanks
VB.NET Web app
Using a 'viewing page' I can pull a pdf file from the DB on the Development W/Station, but on the server it displays a blank page... As images are also stored in the same DB and relative directory, and are no problem, the issue can't be down to a path!
Here is the code
Code:
Imports System.Data
Partial Class Document_Viewer
Inherits System.Web.UI.Page
Private strSQL As String
Private vData As DataConn
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim vID As String = Request.QueryString("Document_ID")
If Not IsNumeric(vID) Then
Exit Sub
End If
strSQL = "SELECT Document_PDF FROM Documents WHERE Document_ID = " & vID
vData = New DataConn
Dim vDocument As Byte()
Try
vDocument = vData.ExecuteScalar(CommandType.Text, strSQL)
Catch ex As Exception
EmailError(ex.Message, "23")
Exit Sub
End Try
Response.ClearHeaders()
Response.AddHeader("content-disposition", "inline=" & vDocument.ToString())
Response.AddHeader("content-length", vDocument.ToString())
Response.ContentType = ("application/pdf")
Response.BinaryWrite(vDocument)
End Sub
The server is W2K as is the workstation and both are running .NET 2.0 Framework.
Any ideas where to look?
Thanks