Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response.AppendHeader problem

Status
Not open for further replies.

manutektips

Programmer
Sep 8, 2003
11
GB
Hi,
I have a problem with opening a gif image. The code is below:
MyFileStream = New FileStream
(strTreeFilePath,FileMode.Open)
FileSize = MyFileStream.Length
Dim Buffer(CInt(FileSize)) As Byte
MyFileStream.Read(Buffer, 0, CInt(FileSize))
Response.ContentType = "image/GIF"
Response.AppendHeader("content-disposition", _
"attachment; filename=" + strTreeFilePath)
Response.OutputStream.Write(Buffer, 0, FileSize)
Response.Flush()
MyFileStream.Close()
Response.Close()
My program is generating a gif file dynamically and stored in a folder. When I try to open that file using the above code, the page is loaded but not picking up the file. This same programs works fine in 1 server but not in another, where both the servers are windows 2003. Please help
 
Are you getting any exception or any error?
Did you check the permissions?

Sharing the best from my side...

--Prashant--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top