Once you get the uploaded file details parse the content of the file using these:
Read a doc/docx file in PHP: https://stackoverflow.com/a/19503654/3151134
PDF Parser library: https://github.com/smalot/pdfparser
This is a basic example on how to upload a file in CI, it's pretty straightforward:
View file in application/views/upload_form.php
<html>
[...]
<body>
<?php echo $error;?>
<?php echo form_open_multipart('upload/do_upload');?>
<input type="file" name="userfile" />
<input type="submit" value="upload" />
</form>
</body>
</html>
Controller in application/controllers/Upload.php
<?php
class Upload extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->helper(array('form', 'url'));
}
public function index()
{
$this->load->view('upload_form', array('error' => ' ' ));
}
public function do_upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'doc|docx|pdf';
$config['max_size'] = 10000; //kilobytes
// Load the Upload Library
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('userfile'))
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
// Get the full path of the file
$fileFullPath = $this->upload->data('full_path');
/*** Parse the file and store its content in the db ***/
// After that maybe show a success page
$this->load->view('<nameofsuccesspageview>');
}
}
}
?>