For your code snippet, I believe you should set the content type as "text/plain" (I don't think there is a "text/download"). You can google for the existing/valid content types.
Also, try setting the content disposition header as "Content-Disposition", with capital letters. The "attachment" part (opposed to "inline") should tell the browser to open the Save as dialog for you. Consider including quotes in your code if your file name might include blank spaces.