Tiff file view problem

G

Guest

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)
 
C

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top