I need to upload a file with the extension .pfx
(digital certificate).
I'm using library
Upload
of CodeIgniter
as follows:
I'm putting the allowed_types extension, but it does not send. Return: The type of file you are trying to upload is not allowed.
$config['upload_path'] = $pasta;
$config['allowed_types'] = 'pfx';
$config['max_size'] = 100000;
$config['encrypt_name'] = TRUE;
$this - > load - > library('upload');
$this - > upload - > initialize($config);
if ($this - > upload - > do_upload('userfile')) {
echo json_encode(array('image1' = > $this - > upload - > data('file_name'), 'file_ext' = > str_replace(".", "", $this - > upload - > data('file_ext')), 'error' = > 0, 'mensage' = > 'Arquivo enviado com sucesso.'));
} else {
echo json_encode(array('mensage' = > $this - > upload - > display_errors(), 'error' = > 1));
}