Code first, file download code
header("Pragma: public"); // required
header("Expires: 0"); // no cache
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: ".$contenttype);
header("Content-Disposition: attachment; filename="".$name . "-" .$MatchNumber.".".$type);
header("Content-Transfer-Encoding: binary");
header("Connection: close");
readfile($savepath);
this code can be executed normally, no problem on PC, no problem on Android browser. At the same time, if you are in the Android version of the WeChat browser, you can call up other browsers to download. The
PS: download file is synthesized from the PHPImage class.
the problem encountered now is:
1. After clicking the download link and entering a series of programs to deal with files, there is no way to get here
2. The built-in browser on Apple"s Wechat is the same problem
. I don"t know if any big shot has ever done this kind of development. I looked up a lot of information and couldn"t find a solution! There is an extreme lack of experience in mobile development. In particular, the ios system and the same series are basically untouched. Get down on your knees and ask the master for advice.