Know how to download the file path from the browser (the file is the source file). at the end of this post, u013293559 is edited from 2014-02-. learn how to download the file path from the browser (the file is the source file) please give me some advice .................... know how to download the file path from the browser (the file is a source file)
At the end of this post, u013293559 Edited on 12:11:05 to know how to download the file path from the browser (the file is a source file) ask the gods to help you ......................
------ Solution --------------------
Header ('content-Disposition: attachment; filename = test. php ');
Readfile ('A. php'); // target file
------ Solution --------------------
$ File_dir = ''; // defines the file path.
$ File_name = ''; // defines the file name
$ File = fopen ($ file_dir. $ file_name, "r"); // open the file
Header ("Content-type: application/octet-stream ");
Header ("Accept-Ranges: bytes ");
Header ("Accept-Length:". filesize ($ file_dir. $ file_name ));
Header ("Content-Disposition: attachment; filename =". $ file_name );
// Output file content
Echo fread ($ file, filesize ($ file_dir. $ file_name ));
Fclose ($ file );
Exit ();
?>