Hello All,
I am working for a while on YII2 and its wonderful.
I am facing an issue regarding the file upload. I want to upload certificate file with .pem extension.
This is failing, when I change the rule to txt it works fine but not with pem file.
here are the rules in which I even tried to user checkExtensionByMimeType
but no luck.
with checkExtensionByMimeType
its giving extension error and with this setting on giving the mimeType error
public function rules()
{
return [
[['file'], 'required', 'message' => 'Please select a file.'],
[['file'], 'file', 'extensions' => 'pem, cer, crt', 'checkExtensionByMimeType' => true, 'mimeTypes' => 'application/x-x509-ca-cert'],
];
}
Regards
Junaid