473,699 Members | 2,625 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 1370

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

Similar topics

5
6916
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, title, command)
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 default for TIFF on client). Basically I need to stream this file to the client and then open in...
6
2967
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 SqlConnection(ConfigurationSettings.AppSettings);
3
5869
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 exception of "A generic error occurred in GDI+" is thrown when performing the conversion/save for display....
6
2721
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
3247
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
5824
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) Ideally it would be nice to display back in the browser since some may be multiple images. I am not...
12
1361
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
2136
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 streaming bytes (I assume that's what I'll be doing) from a database to a web browser and vice...
3
4025
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 error occurred while accessing this document". Here is a link to try out ...
0
8687
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
9034
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
8914
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
8883
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
5874
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();...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
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
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
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.