Hello KK,
I was having issues with phpmailer incorrectly validating files I try to upload and attachment to an email, so I went into the the phpmailer file and added " . $file_ext" to the error output. When I tested the upload again the error showed a 'jpg' file extension yet phpmailer says the extension is not allowed uploaded_img: File extension not allowed "jpg", meanwhile I have already included allowed_ext='jpeg,jpg,gif,png' in the file upload input tag.
I was having issues with phpmailer incorrectly validating files I try to upload and attachment to an email, so I went into the the phpmailer file and added " . $file_ext" to the error output. When I tested the upload again the error showed a 'jpg' file extension yet phpmailer says the extension is not allowed uploaded_img: File extension not allowed "jpg", meanwhile I have already included allowed_ext='jpeg,jpg,gif,png' in the file upload input tag.
- Code: Select all
// validate file extension
$allowed_ext = explode( ',', $this->allowed_ext );
if( $file_ext=='' || !in_array($file_ext, $allowed_ext) ){
return $FUNCS->raise_error( 'File extension not allowed ' . $file_ext );
}