Connecting Tech Pros Worldwide Forums | Help | Site Map

TIFF file does not open

qysbc
Guest
 
Posts: n/a
#1: Jan 19 '06
I have a web page and there is a link to open a TIFF file. The way I do it is
to have the server code open a binary stream, set the content type to
"image/tiff" and call Response.BinaryWrite. On the client machine, the file
type TIFF is associated with Kodak Imaging Preview. This app works on most
client machines. When you click on the link, Kodak Imaging Preview will open
the TIFF file on the client machine. However, on some machines, the file
doesn't open. Is there some browser setting that needs to be done for this to
work?

The following C# code is used:

BinaryReader binReader =
new BinaryReader(File.Open(docPath,
FileMode.Open,FileAccess.Read));
byte[] binFile =

binReader.ReadBytes(Convert.ToInt32(binReader.Base Stream.Length));

int size = binFile.Length;
size = Convert.ToInt32(binReader.BaseStream.Length);

Response.ContentType = "image/tiff";
Response.BinaryWrite(binFile);
binReader.Close();


Peter Rilling
Guest
 
Posts: n/a
#2: Jan 19 '06

re: TIFF file does not open


Are you sure the default app is set correctly for all machines? What
happens if you have a TIFF on the desktop and you double-click it?

"qysbc" <qysbc@discussions.microsoft.com> wrote in message
news:B212C0CA-AD23-4B9F-9B24-C101AA539A2B@microsoft.com...[color=blue]
>I have a web page and there is a link to open a TIFF file. The way I do it
>is
> to have the server code open a binary stream, set the content type to
> "image/tiff" and call Response.BinaryWrite. On the client machine, the
> file
> type TIFF is associated with Kodak Imaging Preview. This app works on most
> client machines. When you click on the link, Kodak Imaging Preview will
> open
> the TIFF file on the client machine. However, on some machines, the file
> doesn't open. Is there some browser setting that needs to be done for this
> to
> work?
>
> The following C# code is used:
>
> BinaryReader binReader =
> new BinaryReader(File.Open(docPath,
> FileMode.Open,FileAccess.Read));
> byte[] binFile =
>
> binReader.ReadBytes(Convert.ToInt32(binReader.Base Stream.Length));
>
> int size = binFile.Length;
> size = Convert.ToInt32(binReader.BaseStream.Length);
>
> Response.ContentType = "image/tiff";
> Response.BinaryWrite(binFile);
> binReader.Close();
>[/color]


Kevin Spencer
Guest
 
Posts: n/a
#3: Jan 19 '06

re: TIFF file does not open


The application that opens a given image file format is determined by what
applications are installed on the machine, and by the configuration of the
machine. Windows does not come with a TIFF file viewer. If software is
installed on the machine that can open and view TIFFs, and it is configured
as the default viewer for the image type, it will open. I would suspect that
no application exists on those machines that cannot open it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"qysbc" <qysbc@discussions.microsoft.com> wrote in message
news:B212C0CA-AD23-4B9F-9B24-C101AA539A2B@microsoft.com...[color=blue]
>I have a web page and there is a link to open a TIFF file. The way I do it
>is
> to have the server code open a binary stream, set the content type to
> "image/tiff" and call Response.BinaryWrite. On the client machine, the
> file
> type TIFF is associated with Kodak Imaging Preview. This app works on most
> client machines. When you click on the link, Kodak Imaging Preview will
> open
> the TIFF file on the client machine. However, on some machines, the file
> doesn't open. Is there some browser setting that needs to be done for this
> to
> work?
>
> The following C# code is used:
>
> BinaryReader binReader =
> new BinaryReader(File.Open(docPath,
> FileMode.Open,FileAccess.Read));
> byte[] binFile =
>
> binReader.ReadBytes(Convert.ToInt32(binReader.Base Stream.Length));
>
> int size = binFile.Length;
> size = Convert.ToInt32(binReader.BaseStream.Length);
>
> Response.ContentType = "image/tiff";
> Response.BinaryWrite(binFile);
> binReader.Close();
>[/color]


qysbc
Guest
 
Posts: n/a
#4: Jan 23 '06

re: TIFF file does not open


I have checked the client machines and they have Kodak Imaging Preview
installed and TIF/TIFF file type is associated with Kodak Imaging Preview. I
can start Kodak Imaging Preview and open a TIFF file from there. I suspect
there is some other setttings that need to be changed.

"Kevin Spencer" wrote:
[color=blue]
> The application that opens a given image file format is determined by what
> applications are installed on the machine, and by the configuration of the
> machine. Windows does not come with a TIFF file viewer. If software is
> installed on the machine that can open and view TIFFs, and it is configured
> as the default viewer for the image type, it will open. I would suspect that
> no application exists on those machines that cannot open it.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Who is Mighty Abbott?
> A twin turret scalawag.
>
> "qysbc" <qysbc@discussions.microsoft.com> wrote in message
> news:B212C0CA-AD23-4B9F-9B24-C101AA539A2B@microsoft.com...[color=green]
> >I have a web page and there is a link to open a TIFF file. The way I do it
> >is
> > to have the server code open a binary stream, set the content type to
> > "image/tiff" and call Response.BinaryWrite. On the client machine, the
> > file
> > type TIFF is associated with Kodak Imaging Preview. This app works on most
> > client machines. When you click on the link, Kodak Imaging Preview will
> > open
> > the TIFF file on the client machine. However, on some machines, the file
> > doesn't open. Is there some browser setting that needs to be done for this
> > to
> > work?
> >
> > The following C# code is used:
> >
> > BinaryReader binReader =
> > new BinaryReader(File.Open(docPath,
> > FileMode.Open,FileAccess.Read));
> > byte[] binFile =
> >
> > binReader.ReadBytes(Convert.ToInt32(binReader.Base Stream.Length));
> >
> > int size = binFile.Length;
> > size = Convert.ToInt32(binReader.BaseStream.Length);
> >
> > Response.ContentType = "image/tiff";
> > Response.BinaryWrite(binFile);
> > binReader.Close();
> >[/color]
>
>
>[/color]
Kevin Spencer
Guest
 
Posts: n/a
#5: Jan 23 '06

re: TIFF file does not open


What exactly is happening on these clients?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"qysbc" <qysbc@discussions.microsoft.com> wrote in message
news:DC6FE78F-A3CC-4AD7-916D-9E4DDF896797@microsoft.com...[color=blue]
>I have checked the client machines and they have Kodak Imaging Preview
> installed and TIF/TIFF file type is associated with Kodak Imaging Preview.
> I
> can start Kodak Imaging Preview and open a TIFF file from there. I suspect
> there is some other setttings that need to be changed.
>
> "Kevin Spencer" wrote:
>[color=green]
>> The application that opens a given image file format is determined by
>> what
>> applications are installed on the machine, and by the configuration of
>> the
>> machine. Windows does not come with a TIFF file viewer. If software is
>> installed on the machine that can open and view TIFFs, and it is
>> configured
>> as the default viewer for the image type, it will open. I would suspect
>> that
>> no application exists on those machines that cannot open it.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> Who is Mighty Abbott?
>> A twin turret scalawag.
>>
>> "qysbc" <qysbc@discussions.microsoft.com> wrote in message
>> news:B212C0CA-AD23-4B9F-9B24-C101AA539A2B@microsoft.com...[color=darkred]
>> >I have a web page and there is a link to open a TIFF file. The way I do
>> >it
>> >is
>> > to have the server code open a binary stream, set the content type to
>> > "image/tiff" and call Response.BinaryWrite. On the client machine, the
>> > file
>> > type TIFF is associated with Kodak Imaging Preview. This app works on
>> > most
>> > client machines. When you click on the link, Kodak Imaging Preview will
>> > open
>> > the TIFF file on the client machine. However, on some machines, the
>> > file
>> > doesn't open. Is there some browser setting that needs to be done for
>> > this
>> > to
>> > work?
>> >
>> > The following C# code is used:
>> >
>> > BinaryReader binReader =
>> > new BinaryReader(File.Open(docPath,
>> > FileMode.Open,FileAccess.Read));
>> > byte[] binFile =
>> >
>> > binReader.ReadBytes(Convert.ToInt32(binReader.Base Stream.Length));
>> >
>> > int size = binFile.Length;
>> > size = Convert.ToInt32(binReader.BaseStream.Length);
>> >
>> > Response.ContentType = "image/tiff";
>> > Response.BinaryWrite(binFile);
>> > binReader.Close();
>> >[/color]
>>
>>
>>[/color][/color]


qysbc
Guest
 
Posts: n/a
#6: Jan 23 '06

re: TIFF file does not open


On most client machines, if you click on the link, a new browser window will
open and the server runs the attached C# code that sends the binary stream to
the browser. The browser window then closes (the opening and closing of the
browser windows takes only a second) and Kodak Imaging Preview opens and
displays the TIFF image.

On the client machines that fails to open the TIFF file, a new browser
window opens and a little image icon is displayed on the window. The browser
window does not close and Kodak Imaging Preview does not open.


"Kevin Spencer" wrote:
[color=blue]
> What exactly is happening on these clients?
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Who is Mighty Abbott?
> A twin turret scalawag.
>
> "qysbc" <qysbc@discussions.microsoft.com> wrote in message
> news:DC6FE78F-A3CC-4AD7-916D-9E4DDF896797@microsoft.com...[color=green]
> >I have checked the client machines and they have Kodak Imaging Preview
> > installed and TIF/TIFF file type is associated with Kodak Imaging Preview.
> > I
> > can start Kodak Imaging Preview and open a TIFF file from there. I suspect
> > there is some other setttings that need to be changed.
> >
> > "Kevin Spencer" wrote:
> >[color=darkred]
> >> The application that opens a given image file format is determined by
> >> what
> >> applications are installed on the machine, and by the configuration of
> >> the
> >> machine. Windows does not come with a TIFF file viewer. If software is
> >> installed on the machine that can open and view TIFFs, and it is
> >> configured
> >> as the default viewer for the image type, it will open. I would suspect
> >> that
> >> no application exists on those machines that cannot open it.
> >>
> >> --
> >> HTH,
> >>
> >> Kevin Spencer
> >> Microsoft MVP
> >> ..Net Developer
> >> Who is Mighty Abbott?
> >> A twin turret scalawag.
> >>
> >> "qysbc" <qysbc@discussions.microsoft.com> wrote in message
> >> news:B212C0CA-AD23-4B9F-9B24-C101AA539A2B@microsoft.com...
> >> >I have a web page and there is a link to open a TIFF file. The way I do
> >> >it
> >> >is
> >> > to have the server code open a binary stream, set the content type to
> >> > "image/tiff" and call Response.BinaryWrite. On the client machine, the
> >> > file
> >> > type TIFF is associated with Kodak Imaging Preview. This app works on
> >> > most
> >> > client machines. When you click on the link, Kodak Imaging Preview will
> >> > open
> >> > the TIFF file on the client machine. However, on some machines, the
> >> > file
> >> > doesn't open. Is there some browser setting that needs to be done for
> >> > this
> >> > to
> >> > work?
> >> >
> >> > The following C# code is used:
> >> >
> >> > BinaryReader binReader =
> >> > new BinaryReader(File.Open(docPath,
> >> > FileMode.Open,FileAccess.Read));
> >> > byte[] binFile =
> >> >
> >> > binReader.ReadBytes(Convert.ToInt32(binReader.Base Stream.Length));
> >> >
> >> > int size = binFile.Length;
> >> > size = Convert.ToInt32(binReader.BaseStream.Length);
> >> >
> >> > Response.ContentType = "image/tiff";
> >> > Response.BinaryWrite(binFile);
> >> > binReader.Close();
> >> >
> >>
> >>
> >>[/color][/color]
>
>
>[/color]
qysbc
Guest
 
Posts: n/a
#7: Mar 16 '06

re: TIFF file does not open


I have figured out the difference between the client machines. The code will
not work if a a browser has plugin to display a TIFF image.

Now, I just open a new window and pass an URL to let a user access a TIFF
file.

Closed Thread