I am trying to upload a video.
My mime setting:
'wmv' => array('video/wmv', 'video/x-ms-wmv', 'flv-application/octet-stream', 'application/octet-stream'), 'flv' => array('video/x-flv', 'flv-application/octet-stream', 'application/octet-stream'), 'mp4' => 'video/mp4', '3gp' => 'video/3gpp'
My opinion:
<div id="upload"> <?php echo form_open_multipart('audio'); echo form_upload('userfile'); echo form_submit('upload','Upload'); echo form_close(); ?> </div>
My controller:
function index() { $this->load->model('Audio_model'); if ($this->input->post('upload')) { $this->Audio_model->do_upload(); } $this->load->view('v_audio'); }
My model:
function do_upload() { $config = array( 'allowed_types' => 'mp4|3gp|flv|mp3', 'max_size'=>'100000', 'upload_path' => $this->gallery_path ); $this->load->library('upload', $config); if ($this->upload->do_upload()) { echo "Upload success!"; } else { echo "Upload failed!"; } }
I can download mp3s successfully, but not mp4, 3gp or flv, all of them cannot load.
source share