Link to home
Start Free TrialLog in
Avatar of cunninw
cunninw

asked on

Downloading BLOB Files from MS SQL 2000 using ASP

I have a database table that looks like this

documentID                  Key Identifier
document_stored          BLOB
filename                       File Name
description                    Text File

I have created an ASP page that displays the documents that are available for download.

I would like to be able to click on the [filename] and be able to download (open or save) the file.  I do not want to have to save the file to the hard drive, because this is a shared account.

Pleas Help
ASKER CERTIFIED SOLUTION
Avatar of WMIF
WMIF

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cunninw
cunninw

ASKER

I tried this solution, but I'm still getting an error.

Here is my code (the content type is application/pdf):

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #include file="../connections.inc" -->
<%
DocID = Request.QueryString("fileID")
set RSDL = conn.execute ("SELECT * From BrokerSitez_Doc_Manager Where " _
& "documentID = '" & DocID & "'")

Response.ContentType =  RSDL("content_type")
Response.AddHeader "Content-Disposition", "inline;filename=" & RSDL("filename")
Response.BinaryWrite RSDL("document_stored")

%>

Here is the error (what the page is displaying):

 <font face="Arial" size=2>
<p>Response object</font> <font face="Arial" size=2>error 'ASP 0106 : 80020005'</font>
<p>
<font face="Arial" size=2>Type Mismatch</font>
<p>
<font face="Arial" size=2>/Prod/Owner/download.asp</font><font face="Arial" size=2>, line 11</font>
<p>
<font face="Arial" size=2>An unhandled data type was encountered.
</font>
which line is 11?  as i count, it points me to a blank line.
Avatar of cunninw

ASKER

Thanks WMIF.

I figured out the problem.  I was using * in the select statement instead of call each object by name.

Everything is working great now.

Thanks Again!
Avatar of Anthony Perkins
>>Everything is working great now.<<
Great!  Now please close the question.  Here's how:

What are my choices?
https://www.experts-exchange.com/Web/Web_Languages/ASP/help.jsp#hi67