Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a multiple file upload form with CI
    text
    copied!<p>hope someone can help me with this.</p> <p>I am developing a form which allows to upload multiple files using CodeIgniter and jQuery to enable multiple file uploads using one uploadfield.</p> <p>But now I get the following errmsg in firebug:</p> <p><em>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.</em> </p> <p>Which means that the HTML-document is not decleared but I don't understand what is going wrong.</p> <p>I have the following controller:</p> <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Upload extends CI_Controller { function Upload(){ parent::Controller(); $this-&gt;load-&gt;helper(array('form', 'url')); } public function index(){ $this-&gt;load-&gt;view('includes/header'); $this-&gt;load-&gt;view('upload'); $this-&gt;load-&gt;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-&gt;load-&gt;library('upload', $config); $this-&gt;load-&gt;library('Multi_upload'); $files = $this-&gt;multi_upload-&gt;go_upload(); if ( ! $files ) { $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors()); $this-&gt;load-&gt;view('upload_form', $error); } else { $data = array('upload_data' =&gt; $files); $this-&gt;load-&gt;view('upload_success', $data); } } } </code></pre> <p>So my first thought is that I have not decleared the Meta-tag in the header but that is not the case:</p> <pre><code>&lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" &gt; &lt;link href="&lt;?=base_url();?&gt;src/css/style.css" rel="stylesheet" type="text/css"&gt; &lt;script src="http://code.jquery.com/jquery-1.8.0.js"&gt;&lt;/script&gt; &lt;script src="&lt;?=base_url();?&gt;src/js/jquery.MultiFile.js"&gt;&lt;/script&gt; &lt;/head&gt; </code></pre> <p>And if I remove the Upload-function from the controller I get an error of calling an undefined method form_open_multipart</p> <p>So I have no idea why I get the errmsg I first stated. Is there someone who can help me with this?</p> <p>Thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload