Cant upload a video file to folder

Hello i have a problem with uploading file to folder.

I added mimes

'mp4'   =>      'video/mp4',
                                'wmv'   =>      array('video/wmv', 'video/x-ms-wmv', 'flv-application/octet-stream', 'application/octet-stream'),
                                'flv'   =>      array('video/flv', 'video/x-flv', 'flv-application/octet-stream', 'application/octet-stream'),
                                'avi'   =>      'video/x-msvideo'

My controller

public function upload_videos(){

  $config['upload_path'] = './uploads/videos';
  $config['allowed_types'] = 'avi|flv|wmv|mpeg|mp3|mp4';
  $config['max_size'] = 0;
  $config['max_width']  = 0;
  $config['max_height']  = 0;
    $this->load->library('upload', $config);

if ( ! $this->upload->do_upload()){
    $error = array('error' => $this->upload->display_errors());
    $this->load->view('media/videos_view', $error);
    $this->session->set_flashdata('success', '<p  red; font-weight:bold; font-size:20px;">Upload successed!<p>');
And I changed upload_max_filesize.

When i submited i have error

You did not select a file to upload.
Please help me what is wrong with it Sad

Does your upload folder have writing permition?

Did you tell the upload class what field name it was so it knows where to look?
if ( ! $this->upload->do_upload('uploadFile')){
Since you aren't using the default 'userfile', you have to tell CI what field it is.

I named, a field call userfile

that look my form

echo form_open_multipart('media_ctrl/upload_videos');
echo form_upload('userfile');
echo '<br />';
echo '<br />';
echo form_submit('upload', 'Upload');
echo form_close();

Ok I changed post_max_size = 30 and it is work. Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.