微信小程序常见问题
# 下载文件
// 清除输出缓冲区
if (ob_get_length()) ob_end_clean();
// 设置响应头
header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');
header('Content-Disposition: attachment; filename="Report.docx"; filename*=UTF-8\'\'' . rawurlencode('文件.docx'));
header('Cache-Control: max-age=0');
header('Expires: 0');
header('Pragma: public');
// 创建 Writer 并输出到 php://output
$writer = IOFactory::createWriter($phpWord, 'Word2007');
$writer->save('php://output');
exit; // 确保脚本终止,不再输出其他内容
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 发布
- 涉及信息发布需要添加类目
资讯 > 信息资讯
- 不一定会被通过,不能涉及第三方APP相关的东西,如:
提现到支付宝
,理由是小程序涉诱导下载行为:利益诱导用户下载app,请移除相关违规功能后再重新提审。
上次更新: 2025/06/24, 16:02:42