myTempWindow = window.open(x,’’,’left=10000,screenX=10000’);
For the other you can force the browser to display a "Save As/Open from current location" dialogue box when it wants to write known binary content to the client.
The official approach for this is to use a http header to request the display of user permission dialog box. This header is known as "Content-Disposition."
Following is the sample for server-side based applications, (almost all http libraries provide an API to set an http header).
HttpResponse.setHeader("Content-Disposition "," attachment; filename= whatever.pdf");
I beleive you can even force Content-Disposition to fit in a meta tag if you don't have the ability to issue server side commands. Something like:
<META HTTP-EQUIV="Content-Disposition" CONTENT="attachment; filename=whatever.pdf">