Header ("Pragma:public");
Header ("cache-control:max-age=". $expire);
Header (' Cache-control:no-store, No-cache, Must-revalidate ');
Header ("Expires:".) Gmdate ("D, D M Y h:i:s", Time () + $expire). "GMT");
Header ("last-modified:".) Gmdate ("D, D M Y h:i:s", Time ()). "GMT");
Header ("content-disposition:attachment; Filename= ". $showname);
Header ("Content-length:". $length);
Header ("Content-type:". $type);
Header (' Content-encoding:none ');
Header ("Content-transfer-encoding:binary");
if ($content = = ") {
ReadFile ($filename);
}else {
Echo ($content);
}
Exit ();
This is a piece of code inside HTTP, but I can only read it out to the browser. Do you have any way to click on the link such as "Download" will appear a box and then enter the name of the save it?
Reply content:
Header ("Pragma:public");
Header ("cache-control:max-age=". $expire);
Header (' Cache-control:no-store, No-cache, Must-revalidate ');
Header ("Expires:".) Gmdate ("D, D M Y h:i:s", Time () + $expire). "GMT");
Header ("last-modified:".) Gmdate ("D, D M Y h:i:s", Time ()). "GMT");
Header ("content-disposition:attachment; Filename= ". $showname);
Header ("Content-length:". $length);
Header ("Content-type:". $type);
Header (' Content-encoding:none ');
Header ("Content-transfer-encoding:binary");
if ($content = = ") {
ReadFile ($filename);
}else {
Echo ($content);
}
Exit ();
This is a piece of code inside HTTP, but I can only read it out to the browser. Do you have any way to click on the link such as "Download" will appear a box and then enter the name of the save it?
Header ("Content-type:application/octet-stream;");
or modify the httpd mime.types inside the corresponding file type is Application/octet-stream