PHPMailer attachment type and size limit

后端 未结 2 806
天命终不由人
天命终不由人 2021-01-27 03:11

i have one form and i am using PHPMailer to send data from that form to my email. Users can send attachments as well, but i have one rpoblem: how to make PHPMailer to deny attac

2条回答
  •  耶瑟儿~
    2021-01-27 03:26

    Use filesize() for checking the file size. For checking if the file is a image use getimagesize() which returns false if it's not an image, else it will return an array of info including mimetype (if you wan't to check for specific image types).

提交回复
热议问题