Gibberish…

I am having a problem with programming. I am attempting to work with a WWW page sending a file – in this case a PNG image. What is happening is that I am getting Gibberish. What I am seeing appears below.

content-disposition: attachment; filename=00000100040040034000000S151000000E33000000S152000000E.png Set-Cookie: ASP.NET_SessionId=2bhvqu550yzjaq3tjsokwx45; path=/ Cache-Control: private Expires: Wed, 03 Aug 2005 01:20:13 GMT Content-Type: imagepng Content-Length: 32772 ‰PNG
akY *&# ( ID()*&*(^&%()*(&^^&%^*(*)(*&***& B*(&*%#$756%^&6767((*78 &&** 89&*&6^^7_*^&&b8(&*&**(&* *&755$&789*^*&9)*98^&*^8**(5^&%678788998908678&(**()78jhyut^&6Uj89^BU

This of course makes no sense. Except for the fact that it is the start of a PNG file, as text. This should not happen like this. Some of the time it just displays in a WWW browser. Most of the time it does not.

The code I am using is under VB.NET and is little more than
Page.Response.WriteFile(“c:junk.txt”)

I just cannot work it out. I have put in an email to Microsoft to see if I can get some answers there…

The code I am using is basically…

Page.Response.ContentType = “image” & extension
Response.AppendHeader(“content-disposition”, “attachment; filename=” + mc.Filename & “.” & extension.ToString)
Page.Response.End()
Page.Response.AddHeader(“Pragma”, “no-cache” & vbCrLf)
Page.Response.Expires = -1

Any hints or ideas?