Opps, bit of a bobo, meant to reply to the guy who was asking about file download in php. I have no idea how you force a download using JS.
In PHP use header - use octet stream rather than file type (eg jpg)
This together with content disposition will correctly force download for a document/image etc.
Caution: absolutely do not allow the file to be choosen using $GET['file'] without cleaning $GET['file'] first.
//set the content as octet-stream
header("Content-Type: application/octet-stream"); //
// tell the thing the filesize
header("Content-Length: " . filesize($download_path.$file));
// set it as an attachment and give a file name
header('Content-Disposition: attachment; filename='.$file);
// read into the buffer