473,569 Members | 3,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Streaming TIFF blob data

Hi I have an issue when trying to stream blob image data from a SQL table to
a .aspx page. the code I have works for GIF and JPEG but the images can be
multiple pages and we would like them to open in a TIFF format.

But since there are invoices with multiple pages, we would like to open as a
TIFF format in Windows Picture and Fax Viewer. (or default for TIFF on
client). Basically I need to stream this file to the client and then open in
this program (or default for TIFF). I initially thought that by streaming and
opening.. it is essentially placing a copy in the clients temp internet files
and then opening from there.

The code I am using is:

SqlConnection myConn = new
SqlConnection(C onfigurationSet tings.AppSettin gs["strConnect ion"]);
SqlCommand myComm = new SqlCommand("Sel ect SX_Image_Data from
SX_ACCSXDB_Imag es where chrBarCode = '" + Request.QuerySt ring["invoice"] +
"'",myConn) ;

myConn.Open();
try
{
byte [] img = (byte[]) myComm.ExecuteS calar();
MemoryStream ms = new MemoryStream();
ms.Write(img, 0, img.Length);
Bitmap bmp = new Bitmap(ms);

bmp.Save(Respon se.OutputStream , ImageFormat.Tif f);

}
catch(Exception )
{
Response.Write( "<center><h4>Th e Invoice you are requesting does not
exist in the system</h4></center>");
}

Expand AllCollapse All
Nov 22 '05 #1
0 1363

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6909
by: Doug Tolton | last post by:
Does PIL still not have a Group4 Tiff decoder available? I can load a group4 Tiff just fine, but when I attempt to show it I get: >>> im = Image.open('images/00000001.tif') >>> im.show() Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\PYTHON23\Lib\site-packages\PIL\Image.py", line 1192, in show _showxv(self,...
0
334
by: Phil | last post by:
Hi I have an issue when trying to stream blob image data from a SQL table to a .aspx page. the code I have works for GIF and JPEG but the images can be multiple pages and we would like them to open in a TIFF format. But since there are invoices with multiple pages, we would like to open as a TIFF format in Windows Picture and Fax Viewer. (or...
6
2960
by: Phil | last post by:
Hi I have an issue when trying to stream blob image data from a SQL table to a .aspx page. the code I have works for GIF and JPEG but the images can be multiple pages and we would like them to open in a TIFF format. What comes back to the screen is garble.... Can anyone help? Thanks The code I am using is: SqlConnection myConn = new...
3
5859
by: T. Davis | last post by:
In C#, I am able to successfully stream a TIFF image that comes from a BLOB field in a database, save it to file, then convert the pages within TIFF file into jpegs (using GDI+) and display on the web (using ASP.NET). However, when I generate the Image object using FromStream (passing in the MemoryStream containing image bytes), an...
6
2711
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!
5
3240
by: Manuel Alves | last post by:
Hi, Is it possible to store media files (like windows .wmv) on SQL Server 2005 and stream it back to the client via media server (not just download it)? Regards, Manuel Alves
3
5809
by: CD | last post by:
An application is logging faxes sent in SQL2000 image column type. I have found code on the net but what it is doing is prompting to save to local which is fine for single page image. Not good for multiple page faxes. I have not been able to locate an example to load in the browser or how to handle multiple image in the one column. 1)...
12
1349
by: msuk | last post by:
All, I have a ADO.NET dataset that contains a jpeg (blob data) and some fields that describe the jpeg. I would like to stream the blob data straight to my ASP.NET 1.1 webform without first saving to disk and display the fields as labels on the same page is this possible? Thanks Msuk
5
2131
by: Jim Bancroft | last post by:
Hi everyone, We've have files we'd like to store in a SQL Server blob or text column and make available online for our clients. Instead of linking to a document sitting on a file server, we figure it'll be easier to manage the document store this way. Could someone point me to a tutorial or online docs on what classes .Net provides for...
3
4004
by: Brad | last post by:
I have an aspx page that is sending pdf files to client browsers: it uses a filestream to read the pdf file and response.binarywrite to send content to the browser. This has worked great for years in IE, Firefox and Opera on windows, and it works on a Mac with Firefox and Opera. But this fails in Safari with the generic message "A network...
0
7703
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...
0
7619
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...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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
7681
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
5228
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...
1
2118
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
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
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...

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.