【发布时间】:2021-10-26 06:34:33
【问题描述】:
我刚开始学习 codeigniter 4。如何修改下面的代码以使用自定义文件名和正确的扩展名从数据库下载文件。谢谢。
public function download($payment_id){
$invoicePaymentModel = new InvoicePaymentModel();
$file = $invoicePaymentModel ->find($payment_id);
return $this->response->download('uploads/'.$file['payment_proof'], NULL)->setFileName("testing");
}
【问题讨论】:
-
这应该是工作方法,你得到什么错误?你能发布错误或描述你得到的行为吗?