Take the 2-minute tour ×  I want to write a file-download page
for customers to download files from my company servers.  And I
don't want to expose the real file link to users, so I have two
pages : filelist.php for offering a link to click and posting
the file name as parameter to the other page, named download.php
, accepting the request and transferring file stream to
customers.  The key part of download.php is like this:  $fp =
fopen($real_file_path,'r'); $file_size =
$temp_res['ef_file_bytes']; Header("Accept-Ranges: bytes");
Header("Accept-Length: ".$file_size); Header("Content-
Disposition: attachement;filename=".$file_name); echo
fread($fp,$file_size);  Now I use an onclick() function in
filelist.php ,when the file link is clicked ,the function
following is called:  function downloadfile( ef_name )
var url_str='download.php';         url_str =
encodeURI(url_str);         url_str,{fnm:ef_name },  But I can
only show the file's content in page rather than popping up a
dialog-window to save it.  I