• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

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
0
cunninw
Asked:
cunninw
  • 2
  • 2
1 Solution
 
WMIFCommented:
check out this question for some sample code:
http:Q_11502858.html
0
 
cunninwAuthor Commented:
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>
0
 
WMIFCommented:
which line is 11?  as i count, it points me to a blank line.
0
 
cunninwAuthor Commented:
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!
0
 
Anthony PerkinsCommented:
>>Everything is working great now.<<
Great!  Now please close the question.  Here's how:

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now