• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • 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
  • 2
  • 2
1 Solution
check out this question for some sample code:
cunninwAuthor Commented:
I tried this solution, but I'm still getting an error.

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

<!-- #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>
<font face="Arial" size=2>Type Mismatch</font>
<font face="Arial" size=2>/Prod/Owner/download.asp</font><font face="Arial" size=2>, line 11</font>
<font face="Arial" size=2>An unhandled data type was encountered.
which line is 11?  as i count, it points me to a blank line.
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!
Anthony PerkinsCommented:
>>Everything is working great now.<<
Great!  Now please close the question.  Here's how:

What are my choices?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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