473,659 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to download BLOB IMAGE using ODBC

1 New Member
Hi everyone,

This is an issue I have been picking away at for the past two weeks and am running short of ideas. :-\ I am writing an ASP page that allows a user to open/save a tif image stored on SQL Server.

The user triggers the download by clicking a hyperlink which loads getAttachment.a sp (code listed below). GetAttachment.a sp connects to SQL Server through an ODBC and attempts to download the specified tiff using BinaryWrite(). It looks like the file being downloaded is very close in size to the image but, not a tiff.

Are there any procedures I may be missing when attempting to retrieve the image?
Is a byte array necessary when trying to pass an image type from a table to the web browser?

Any suggestions would be greatly appreciated.


images.table
Image ID(int): att_id
Image Blob(image): ATTACHMENT

Image filename:QM1BM. TIF
---------------------------------------------------------------------------------------

<%
dim objConn, objRS, strSQL, strConnection
dim PubID
PubID = 3751

Response.Clear
Response.Expire s = -1
Response.Conten tType ="image/tiff"

set objConn=server. CreateObject ("ADODB.connect ion")
objConn.Connect ionString="DSN= DPA_Database;ui d=user_id;pwd=p wd;DATABASE=DPA _Database;APP=A SP script;NETWORK= DBMSSOCN;TABLE= dbo.DPA_IMAGES"
source=DOUG
objConn.Open

set objRS=server.Cr eateObject ("ADODB.Records et")
strSQL= "SELECT * FROM dbo.DPA_IMAGES WHERE att_id='"& PubID &"'"
set objRS=objConn.E xecute(strSQL)

'Let the browser know the file name'
Response.AddHea der "Content-Disposition", "attachment;fil ename='"& (objRS("R1_ID") ) &"'.tiff"
'Let the browser know the file size'
'Response.AddHe ader "Content-Length", "500000"'
Response.Binary Write (objRS("ATTACHM ENT"))
Response.End

objRS.Close
objConn.Close
set objConn = nothing
set objRS = nothing
%>
Jan 24 '07 #1
0 1637

Sign in to post your reply or Sign up for a free account.

Similar topics

7
7086
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and disadvantages of using a MySQL blob field rather than reading the images directly from the file? How does one insert an image into a blob field? Can it be done dynamically? Thank you John
11
5857
by: CSN | last post by:
Is it possible to iterate over an array in plpgsql? Something like: function insert_stuff (rel_ids int) .... foreach rel_ids as id insert into table (rel_id, val) values (id, 5);
10
5224
by: Peter Stojkovic | last post by:
I want store an integer-array of 1000 Values in a blob in a SQL-database. I will do this every 10 Seconds. How can I do this ???? What datatypes a have to use ??? Thanks
0
1150
by: LuisH | last post by:
Hi, I'm very new on this group. I don't know if this is a old point here. My question is: What is the best way to access Blob rows using C/C++ on PostgreSQL ????? 1) Using ODBC and using SELECT I can use SQLGetData to receive many parts of each Blob.
3
2912
by: Chris | last post by:
Hi all, I am trying to use System.Data.ODBC to insert a file into a binary field in SQL Server 2000. Now, before you yell at me, the reason I am doing this is that I am only writing intitial code against SQL, but this app will need to be able to run against any ODBC compliant DB, so I am also not using stored procedures. I have tangles with this for hours, but I cannot seem to figure out how to just read the contents of a file off...
2
4562
by: Chenna Sudarsan | last post by:
Hello, I am connecting to Oracle9.2 database from VB6.0 using MSDAORA provider. I am using ADO2.5. When I try to access a blob column of oracle I am getting the below mentioned error. -------------------- Run-time error '-2147467259 (80004005)': Data type is not supported.
4
2766
by: satish mullapudi | last post by:
Hi Gurus, I am using DB2 UDB 8.2.I want to load/insert images into DB2 database.So I found out we need to enable DB2 Image extender .How to enable that extender? Please tell the complete process to enable that Db2 Image Extender & the following steps to insert images into the database. Please Help me out...........
0
973
by: bfiser | last post by:
This is the error I get when I try to open my asp page. When I try to open the HTML page that uses the ASP page as a source for my image I get a box for an image but it has the icon for a broken image. Technical Information (for support personnel) · Error Type: Server object, ASP 0177 (0x800401F3) Invalid class string /ben/bam3.asp, line 11 · Browser Type:
8
3852
by: Godzilla | last post by:
Dear all, I cannot find a solution for my problem with inserting a blob object (>4000 in length) into an ORACLE database via ODBC. I have tried the two ways of inserting the blob object (a zip file): 1)
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.