By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,189 Members | 2,167 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,189 IT Pros & Developers. It's quick & easy.

Displaying a tif image to the user.

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.