Martin said:
Thanks for the reply. My needs are simple. I have several text files
(usually CSV) that I want to download via JavaScript to a user's computer.
If you are still talking about _file_ download, you cannot do that. The
download, whether being file download or not, is performed by the user
agent, _not_ the J(ava)Script engine. (window.)location, for example,
refers to a host object.
So you can only trigger a HTTP request by accessing a property of a host
object (say, window.location.href). The request is performed by the HTTP
client, and responded to by your HTTP server. If you want file download,
your server has to tell this to the HTTP client in the response (by one
of the means I mentioned before). The client will then display the file
download dialog and perform the download if the user confirms. The script
engine does not have anything more to do with that.
If you are not talking about file download, i.e. not download of the
resource to a file on the local filesystem, you should explain what
exactly you are trying to do, and where it has to work.
[...] Does anybody else have a better idea and how I can get a
notification (event) back, when the transfer completes?
Which part of "This is not possible." in my posting is unclear to you?
There is no such event, at least not cross-browser. The script engine
considers the job done after accessing the property of the host object.
Follow the link to the MSKB I provided, it contains information how you
can accomplish that (without client-side browser scripting, of course).
And please quote the minimum of what you are replying to next time:
<URL:
http://jibbering.com/faq/faq_notes/pots1.html#ps1Post>
PointedEars