If you could provide a url to the download page, so we can take a look at the error messages that are showing up, that would be helpful in determining the cause of the error.
One thing you should try is to open a new blank page and try setting up a simple download script that just uses static values to download a file. See if there is anything strange about that page. It could be that when you applied the download behavior the first time, it was applied incorrectly.