Solved

Downloading BLOB Files from MS SQL 2000 using ASP

Posted on 2006-11-29
5
268 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Live mode in DW, need to creae Session 4 107
PDF Embed pdfobject.js local path problem regular ASP 2 181
rebind a grid after user clicks on node in treeview 1 41
ASP exit 10 20
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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 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