我正在开发一种表单,该表单允许用户上传多个文件(doc,pdf,jpg,png)以使用PHPmailer发送至电子邮件。我已经将其与doc,jpg和png一起使用,但是由于某些原因,它不适用于任何pdf文件。有人可以告诉我是什么问题吗?
我的代码:
<input type="file" id="file" name="file[]" multiple="multiple">
for($ct=0;$ct<count($_FILES['file']['tmp_name']);$ct++) {
$this->mailer->AddAttachment($_FILES['file']['tmp_name'][$ct], $_FILES['file']['name'][$ct]);
}