Welcome Guest, Not a member yet? Register   Sign In
Uploading Video files
#1

[eluser]Unknown[/eluser]
I am using xampp for windows version 1.7.3
I can upload image files and mp3 files but when i select .avi or .mpeg or any other video file i get the following error message.
"File type is not allowed..."

The mime has all the extensions and my apache mime also has the extensions. i have them in the $config['allowed_types'] = 'avi|gif|jpg|png|jpeg|mp3|mpg|mpeg'; as well but no luck what soever.... I use the same code as it is in the code igniter user guide page.

Code:
<?php

class Upload extends CI_Controller {

    function __construct()
    {
        parent::__construct();
        $this->load->helper(array('form', 'url'));
    }

    function index()
    {
        $this->load->view('upload_form', array('error' => ' ' ));
    }

    function do_upload()
    {
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'avi|gif|jpg|png|jpeg|mp3|mpg|mpeg';
        $config['max_size']    = '100';
        $config['max_width']  = '1024';
        $config['max_height']  = '768';

        $this->load->library('upload', $config);

        if ( ! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());

            $this->load->view('upload_form', $error);
        }
        else
        {
            $data = array('upload_data' => $this->upload->data());

            $this->load->view('upload_success', $data);
        }
    }
}
?>

Thanks in advance.




Theme © iAndrew 2016 - Forum software by © MyBB