470,601 Members | 1,181 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,601 developers. It's quick & easy.

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 11546
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Vinay | last post: by
1 post views Thread by http://www.visual-basic-data-mining.net/forum | last post: by
8 posts views Thread by Jon Weston | last post: by
1 post views Thread by ChristoinSD | last post: by
4 posts views Thread by redpears007 | last post: by
11 posts views Thread by Usenet User | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.