Hi,
I think your code is correct.
What error if you navigate to that downloadimage.aspx?fileid=xxx ?
By the way , are you using ASP.NET2.0 ?
If you use theme , make sure you change the <head> to <head runat="server"> in the downloadimage.aspx
Regards , Terry .