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) ask the gods to help you ...................... ------ solution -------------------- know how to download the file path from the browser (the file is the source file)
This post was last edited by u013293559 at 12:11:05
Know how the file path can be downloaded from the browser (the file is the source file ......................
------ 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 ();
?>