473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Displaying a tif image to the user.

I have to display tif images using .asp page. I have tried to read the image
as a binary file and stream it to the browser. The relevant code is as
follows. Unfortunately, the display on the browser is a lot of gobledygook.
How can I ensure that the image displays correctly in the browser?

Dim objStream
Dim FilImage, FolImage, strFilImage
Dim adTypeBinary adTypeBinary = 1

Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile "\\servername\image.tif"
Response.ContentType = "application/tif"
'I have also tried "image/tif"
Response.BinaryWrite
objStream.Read
objStream.Close
Set objStream = Nothing

Currently, if the user wants to view a .tif image, double clicking on the
image file launches a software known as "Imaging for Windows Preview". If ie
explorer can't display .tif images, it would be ok if the asp page can
somehow lauch this software on the users machine and display the image in
it.
Thanks a lot
-M
Jul 19 '05 #1
2 11738
ASP can't launch anything on the user's browser.
IE can't display .tif files, the Imaging for Windows Preview is the default
viewer in Windows 2000 (and earlier?) and Windows XP's default is the Fax
and Picture Viewer.

If you want the tif's to display in the browser you have to convert them to
a format that the browsers will support (JPG, GIF, PNG come to mind)

"Srinivas Chundi" <no**********@hotmail.com> wrote in message
news:ei**************@TK2MSFTNGP12.phx.gbl...
I have to display tif images using .asp page. I have tried to read the image as a binary file and stream it to the browser. The relevant code is as
follows. Unfortunately, the display on the browser is a lot of gobledygook. How can I ensure that the image displays correctly in the browser?

Dim objStream
Dim FilImage, FolImage, strFilImage
Dim adTypeBinary adTypeBinary = 1

Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile "\\servername\image.tif"
Response.ContentType = "application/tif"
'I have also tried "image/tif"
Response.BinaryWrite
objStream.Read
objStream.Close
Set objStream = Nothing

Currently, if the user wants to view a .tif image, double clicking on the
image file launches a software known as "Imaging for Windows Preview". If ie explorer can't display .tif images, it would be ok if the asp page can
somehow lauch this software on the users machine and display the image in
it.
Thanks a lot
-M

Jul 19 '05 #2
It is ok if the browser cannot display the .tif files.

If the asp can be made to spit out the tif file as it is, that is adequate.
I am hoping the browser will then prompt the user to open or save the file.
(like say when we are downloading a .zip file form the net) Clicking 'open'
should then launch the default viewer for the tif file.

When I put a hyperlink in a simple html page to the physical location where
the file is located, it actually does something like that. However, I am not
allowed to let the user see where the file is physically located and so I am
hoping asp can read it and stream it to the user in a binary format.
Thanks
-M
"Tom B" <sh*****@NOSPAMhotmail.com> wrote in message
news:un**************@TK2MSFTNGP10.phx.gbl...
ASP can't launch anything on the user's browser.
IE can't display .tif files, the Imaging for Windows Preview is the default viewer in Windows 2000 (and earlier?) and Windows XP's default is the Fax
and Picture Viewer.

If you want the tif's to display in the browser you have to convert them to a format that the browsers will support (JPG, GIF, PNG come to mind)

"Srinivas Chundi" <no**********@hotmail.com> wrote in message
news:ei**************@TK2MSFTNGP12.phx.gbl...
I have to display tif images using .asp page. I have tried to read the image
as a binary file and stream it to the browser. The relevant code is as
follows. Unfortunately, the display on the browser is a lot of

gobledygook.
How can I ensure that the image displays correctly in the browser?

Dim objStream
Dim FilImage, FolImage, strFilImage
Dim adTypeBinary adTypeBinary = 1

Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile "\\servername\image.tif"
Response.ContentType = "application/tif"
'I have also tried "image/tif"
Response.BinaryWrite
objStream.Read
objStream.Close
Set objStream = Nothing

Currently, if the user wants to view a .tif image, double clicking on the image file launches a software known as "Imaging for Windows Preview". If ie
explorer can't display .tif images, it would be ok if the asp page can
somehow lauch this software on the users machine and display the image

in it.
Thanks a lot
-M


Jul 19 '05 #3

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

Similar topics

7
by: Vinay | last post by:
Hi All: I have a small application that stores images either in the database or as files (depending on the user preference). I'm in the process of providing a web interface to this application....
33
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show...
1
by: http://www.visual-basic-data-mining.net/forum | last post by:
I have a page where it requires user to upload an image file to the server. For the uploading, i am using HTML imput file control. Is there a way where after the user has selected a picture file,...
8
by: Jon Weston | last post by:
I'm setting up an Access2003 database with pictures. I put a bound ole picture ctrl on a form that's source is the table that contains the pictures and follow ALL the directions for embedding a...
1
by: ChristoinSD | last post by:
I am new to PHP and coding. I have several domains that use splash pages that point to my main site: i.e. http://www.mysite.com/index.php. How do I replace an image, named "Logo.gif" on the...
4
by: redpears007 | last post by:
Hi Again, Throwing this one out to you again as i am not getting anywhere and can find little to no information out there. I am currently displaying images (Jpegs) in access via the routine...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
11
by: Usenet User | last post by:
..NET 1.1/2.0 I have a need to display high-resolution scrollable images in a .NET application (Windows Forms). One well known solution is to create a Panel with AutoScroll set to "true" and...
0
by: readnlearn | last post by:
hai, i have written this below code for displaying captcha image whenever i entered incorrect uname,password in login page. for that i disable the controls of captcha like textbox,labels,button and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...

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.