I have a small function that is supposed to trigger an ajax request on the click of a button (using scriptaculous & prototype). The request url is building a picture and then needs to send it back as a download but the response is not comming as an attachment but the picture itself in the response headers. How do I do to send an attachment back to the browser using ajax request?

Here's my response headers. I'm sending it as attachment:

Date Tue, 29 Jan 2008 18:24:41 GMT
Server Apache/2.2.6 (Win32) DAV/2 mod_ssl/2.2.6 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5
X-Powered-By PHP/5.2.5
Expires 0
Cache-Control private
Pragma public
Set-Cookie PHPSESSID=1388fbc0081a8c809fdaec765d5ab30e; path=/ PHPSESSID=1388fbc0081a8c809fdaec765d5ab30e; path=/
content-disposition attachment; filename="ws_Elisha_Cuthbert_1600x1200_1_83.jpg"
Content-Length 276917
Keep-Alive timeout=5, max=100
Connection Keep-Alive
Content-Type image/jpeg