473,587 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieve Binary Data from SQL 2005!! Help PLS

23 New Member
hello everybody:

I've a page where upload .doc and .pdf to my DB (sql 2005), I tried many times to retrieve that information but I can't do it.
My idea is:
an ASP page with links, when somebody click that link, retrieve the .doc or .pdf from the DB. I've an unique ID per line. so I can know what row I want to retrieve.

when the user click the link, my idea is to show a new windows where the user can select SAVE or OPEN.

I don't know what is the ASP code to retrieve the information from a binary data
field.

somebody has the code in ASP for that or any link to help me how to build the code for that?

I really appreciate any help

Thank you
NIKO
Sep 5 '07 #1
1 2036
jhardman
3,406 Recognized Expert Specialist
Niko,

The code you are looking for is ADO.STREAM , this is used to take a binary data from a db and send it to the user (or vice versa). I could probably walk you thru it, but I don't do it often enough for it to be really easy for me, so check out what w3schools has to say (the link above) and if that doesn't tell you enough, google it. If it still isn't clear I will try to do my best.

BTW, giving the user an option to open or save is a browser- and user preferences- dependent behavior and I don't think you can set this with traditional HTML. However, when the browser gets a word doc or PDF file it should present it with appropriate behavior.

Jared
Sep 5 '07 #2

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

Similar topics

6
2713
by: | last post by:
Hi all, is there a better way to stream binary data stored in a table in sql 2005 to a browser in .net 2.0? Or is the code same as in .net 1.1? We noticed that in certain heavy load scenarios, every now and then the client would timeout and have to re-initiate the request... TIA!
0
2331
by: Wescotte | last post by:
I'm abit confused on how to work with binary data with an ODBC connection (My database is DB2 btw) Say I have a table like CREATE TABLE EJWLIB.BLOBTEST ( ID NUMERIC(5) NOT NULL, FILENAME VARCHAR(128) NOT NULL, BINARY BLOB(2M) ) Now I (I assume this is the correct method) insert data in the
4
8308
by: dirtside | last post by:
I've search far and wide for an answer, so forgive me if this is a stupid question. (Well, it probably is.) Consider the following JavaScript: var foo = new Image(); foo.src = "http://some.server.com/some_filename.gif"; Now, the browser will retrieve 'some_filename.gif' from some.server.com and put it into the object foo. What I want...
1
2037
by: stockblaster | last post by:
Hello all.. Is it possible to convert a DataTable (i create the DataTable from a CSV file) into binary data and save it into an sql 2005 table (into binary field). After that I want to have the ability to add a row to the beginning of the to the binary data.. And ability to remove a row..
4
1583
by: david | last post by:
I remember that there are functions to do it, but I forgot their names. Anyone can give me a help? Thank you. David
2
1400
by: Karl | last post by:
Hi All, I am working my way through the Personal Web Starter Kit from Microsoft and understand how the storing of images in a database works, but I was wondering if anyone could shed any light on how to store and retrieve documents, such as a pdf or a word document, which need to be downloaded to a clients computer and not just rendered on...
2
8187
by: Marcus | last post by:
(Appologies if this group isn't the best place for this post) Is it possible to use DAO 3.6 to access binary data (varbinary(max)) in Sql Server 2005? I have images and sound in a Sql 2005 DB that I need to retrieve (and write) with DAO (ADO and ADO.Net are not options as this is legacy code that can't be changed). Thx, Marcus
0
1338
by: huiling25 | last post by:
This is how i insert binary data to a binary file: -> fingerprint is a BitSet format File binFile = new File("BinaryFp.txt"); FileOutputStream output = new FileOutputStream (binFile); DataOutputStream data = new DataOutputStream (output); for(int j=0,len=1024;j<len;j++) { boolean bit = fingerprint.get(j); data.writeBoolean(bit);
2
3177
by: =?Utf-8?B?c2NvdHRybQ==?= | last post by:
Hi I am using a SQL Server 2005 varbinary(max) to store word documents in the database. I can retrive the data out into a MemoryStream object ok but I want to be able to use this to display the file in a web browser from an asp.net page. I found quite a lot of articles like this http://support.microsoft.com/kb/306654 that tell you do do it...
0
8347
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...
1
7973
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...
0
8220
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...
0
6626
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...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
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...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
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
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.