Header (& amp; quot; Pragma: public & amp; quot;); header (& amp; quot; Cache-control: max-age & amp; quot ;. $ expire); header (& #039; Cache-Control: no-store, no-cache, must-revalidate & #039;); header (& amp; quot; Expires: & amp; quot ;. gmdate (& amp; quot ;... 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 in http, but I can only read it in the browser. Is there any way to click the link such as "Download" and a pop-up box will pop up and enter the Save name and 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 in http, but I can only read it in the browser. Is there any way to click the link such as "Download" and a pop-up box will pop up and enter the Save name and save it?
header("Content-type: application/octet-stream;");
Or modify the file type in the mime. types of httpd to application/octet-stream.