Home All Groups Group Topic Archive Search About
Author
31 Dec 2005 1:00 AM
Bala
Hi

I try to download the tiff files from my server. Its get downloaded but I
cannot open with windows fax viewer. its says "No preview available"

thanks
bala

here is the code which I am using


Dim ext As String = Path.GetExtension(path1)
            If UCase(Right(ext, 3)) = "TIF" Then
                Response.ContentType = "Image/tiff"
            Else
                Response.ContentType = "Application/pdf"
            End If

            If forceDownload Then
                Response.AppendHeader("content-disposition", "attachment;
filename=" & name)
            Else
                Response.AppendHeader("content-disposition", "inline;
filename=" & name)
            End If
            '
Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name())

            Dim MyFileStream As FileStream
            Dim FileSize As Long

            MyFileStream = New FileStream(fname, FileMode.Open)
            FileSize = MyFileStream.Length

            Dim Buffer(CInt(FileSize)) As Byte
            MyFileStream.Read(Buffer, 0, CInt(FileSize))
            MyFileStream.Close()
            Response.BinaryWrite(Buffer)

Author
31 Dec 2005 2:03 PM
Christopher Reed
Did you verify that the tiff is associated with any viewer?  Is there a
possibility that the tiff header is getting lost or corrupted in either the
download or the viewing?  In my experience, while tiff files are fairly easy
to work with, they are also fairly easy to mess up as well.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Show quoteHide quote
"Bala" <B***@discussions.microsoft.com> wrote in message
news:F709B9B5-BDC1-4374-B6E7-276607FD7884@microsoft.com...
> Hi
>
> I try to download the tiff files from my server. Its get downloaded but I
> cannot open with windows fax viewer. its says "No preview available"
>
> thanks
> bala
>
> here is the code which I am using
>
>
> Dim ext As String = Path.GetExtension(path1)
>            If UCase(Right(ext, 3)) = "TIF" Then
>                Response.ContentType = "Image/tiff"
>            Else
>                Response.ContentType = "Application/pdf"
>            End If
>
>            If forceDownload Then
>                Response.AppendHeader("content-disposition", "attachment;
> filename=" & name)
>            Else
>                Response.AppendHeader("content-disposition", "inline;
> filename=" & name)
>            End If
>            '
> Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name())
>
>            Dim MyFileStream As FileStream
>            Dim FileSize As Long
>
>            MyFileStream = New FileStream(fname, FileMode.Open)
>            FileSize = MyFileStream.Length
>
>            Dim Buffer(CInt(FileSize)) As Byte
>            MyFileStream.Read(Buffer, 0, CInt(FileSize))
>            MyFileStream.Close()
>            Response.BinaryWrite(Buffer)



Post Thread options