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