I was trying to save the '.xls', '.doc', '.wmv' on user machine, which works correctly on Firefox(developer friendly) but not on Microsoft's IE(Microsoft friendly);
after searching on the net, i found this code which works on both the browser.
here is the code:
// downloading a file
$filename = $_GET['path'];
// fix for IE catching or PHP bug issue
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// browser must download file from server instead of cache
// force download dialog
// use the Content-Disposition header to supply a recommended filename and
// force the browser to display the save dialog.
header("Content-Disposition: attachment; filename=".basename($filename).";");
The Content-transfer-encoding header should be binary, since the file will be read
directly from the disk and the raw bytes passed to the downloading computer.
The Content-length header is useful to set for downloads. The browser will be able to
show a progress meter as a file downloads. The content-lenght can be determines by
filesize function returns the size of a file.