Improve suggested filename on download

For all of the following URLs, "file.pdf" will be suggested:
http://.../file.pdf
http://.../download.aspx?file=file.pdf&whatever
http://.../get.pdf?name=file.pdf&whatever
http://.../single-page-app#view=file.pdf
http://.../download.aspx?file=%2Fpath%2Fto%2Ffile.pdf&whatever

Fixes #3161