Solved

Downloading BLOB Files from MS SQL 2000 using ASP

Posted on 2006-11-29
5
258 Views
Last Modified: 2010-08-05
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
Comment
Question by:cunninw
  • 2
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
WMIF earned 500 total points
ID: 18041989
check out this question for some sample code:
http:Q_11502858.html
0
 

Author Comment

by:cunninw
ID: 18045046
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
 
LVL 22

Expert Comment

by:WMIF
ID: 18047028
which line is 11?  as i count, it points me to a blank line.
0
 

Author Comment

by:cunninw
ID: 18049483
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
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18050599
>>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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now