I want to be able to download a web file, but when the download dialog open, the filename is renamed.
Ex: File: http://
You can't do that in Javascript. The "Save to"-dialog is openend by the browser and you can't access that through JS, it's a standard-dialog from the OS.
Your server must provide the file with the desired name before the user clicks on the download-link.
What's the reason that you want to rename the downloaded file anyway?