|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Tiff file view problemI 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) 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. -- Show quoteHide quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "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)
Is this possible...
Case in Join suggestions for smart card or biometric web authentication? Accessing Session variables when using SQL Server for Session state ASP to ASP.net -- Include Files? Page level security with attributes - bad idea? ASP.NET webservice & Javascript ASP.NET bug in SMTP Possible unintended reference comparison Pre_Init for User Control is not firing in ASP.NET 2.0 |
|||||||||||||||||||||||