Search code examples
vb.netzipashx

vb Writefile zip issue comes as a ashx


I have a ashx page handling file/attachment requests

last line of code is

System.Web.HttpContext.Current.Response.WriteFile(filename)

It ends up downloading a file called GetFile.ashx (which sounds like a page name but if I rename the .ashx to .zip it is actually the correct file...

Any reasons why this might be happening and how to stop it?


Solution

  • problem was solved needed to add a header value which set its filename and contenttype!