Martin A. Weinberger wrote:
I solved part of the problem by using:
location.href = "WhatToDownload.ext";
The next question is how to get a notification of when the download
completes.
This is not possible.
Furthermore, the above does not necessarily download the resource as a
file to the local filesystem. One of the following conditions must be
met before that happens:
A) The resource is served with `Content-Disposition: attachment'.
This does not work in Internet Explorer 5.5 SP1:
<URL:http://support.microsoft.com/kb/279667/EN-US/>.
B) The resource is served with an unregistered or unsupported media type
(Content-Type header), or with the media type application/octet-stream
(where the latter would be the correct approach).
C) The resource is served without a media type, or with an unrecognized
media type, or from the name of the resource, particularly its name
suffix, the user agent cannot infer to a supported resource type.
This behavior depends heavily on the user agent and its configuration,
including the installed plugins.
Your code suggests that you rely only on C) which is not recommended.
PointedEars