hope someone can help me with this.
I am developing a form which allows to upload multiple files using CodeIgniter and jQuery to enable multiple file uploads using one uploadfield.
But now I get the following errmsg in firebug:
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol.
Which means that the HTML-document is not decleared but I don't understand what is going wrong.
I have the following controller:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Upload extends CI_Controller {
function Upload(){
parent::Controller();
$this->load->helper(array('form', 'url'));
}
public function index(){
$this->load->view('includes/header');
$this->load->view('upload');
$this->load->view('includes/footer');
}
function do_upload()
{
$config['upload_path'] = './uploads/'; // server directory
$config['allowed_types'] = 'gif|jpg|png'; // by extension, will check for whether it is an image
$config['max_size'] = '1000'; // in kb
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$this->load->library('Multi_upload');
$files = $this->multi_upload->go_upload();
if ( ! $files )
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $files);
$this->load->view('upload_success', $data);
}
}
}
So my first thought is that I have not decleared the Meta-tag in the header but that is not the case:
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link href="<?=base_url();?>src/css/style.css" rel="stylesheet" type="text/css">
<script src="http://code.jquery.com/jquery-1.8.0.js"></script>
<script src="<?=base_url();?>src/js/jquery.MultiFile.js"></script>
</head>
And if I remove the Upload-function from the controller I get an error of calling an undefined method form_open_multipart
So I have no idea why I get the errmsg I first stated. Is there someone who can help me with this?
Thanks in advance