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

[eluser]Gewa[/eluser]
I have problem with uploading .flv and .mp4 files.


I have added in mimes.php

Code:
'flv' => 'video/x-flv',
                'mp4' =>'video/x-mp4',



here is 2 functions that should make upload, one is the form.

Code:
function  add_videos($lid,$type="step1"){






       if($type=="step1"){

              $data['my_box']   ="<center><b>Add Video-STEP1</b></center><br><br>";
                  $data['my_box']  .= anchor("/admin/places/add_videos/$lid/stream/","1.Streaming Video(YouTube or other)")."<br>";
                   $data['my_box']  .= anchor("/admin/places/add_videos/$lid/local_file/","2.Upload .FLV or MPG4");
                  }

        elseif($type=="local_file"){


            $attr = array(
              'name'        => 'file1',
              'id'          => 'username'

            );



            $data['my_box']   ="<center><b>Add Video(.flv and .mpg4 ONLY. max 15mb!!!)</b></center><br><br>"
        .form_open_multipart("/admin/places/do_add_videos/$lid/local_file")


          ."<b>Video Title</b><br>"
        ."&lt;input type=\"text\" name=\"title\"  size=\"40\"&gt;&lt;br>"





          ."<b>Video File</b><br>"
        .form_upload($attr)."<br><br>"





            ."&lt;input type=\"submit\" value=\" SAVECHANGES \"&gt;&nbsp;&nbsp;"

        ."&lt;/form&gt;";
                 }

         elseif($type=="stream"){
                      $data['my_box']   ="<center><b>Add Video-STEP2-STREAMING FROM OTHER SITES WITH EMBEDDING</b></center><br><br>";

                      $data['my_box']  .=  form_open_multipart("/admin/places/do_add_videos/$lid/stream")



                                     ."<b>Video Title</b><br>"
                                       ."&lt;input type=\"text\" name=\"title\"  size=\"40\"&gt;&lt;br>"

                                ."<b>Embedding Code </b><br>"
                                 ." &lt;textarea name=\"comment\" class=\"mceNoEditor\" cols=\"50\" rows=\"20\"&gt;&lt;/textarea><br><br>"

                                           ."&lt;input type=\"submit\" value=\" SAVECHANGES \"&gt;&nbsp;&nbsp;"

                                 ."&lt;/form&gt;" ;






         }














            $this->load->view('admin_panel',$data);







}


  function do_add_videos($lid,$type){
       $data['my_box']="";

     if($type=="local_file"){




        $config['upload_path'] = './images/lokale/videos';
               $config['allowed_types'] = 'mp4|flv|swf';


               $config['overwrite'] =FALSE;
             $this->load->library('upload', $config);




                   $data['my_box']="Results ";


             $field_name = "file1";
                 if($this->upload->do_upload($field_name)){


                   $data['my_box'] .="<a >";
                  $video_info=$this->upload->data();
                     $video_name=$video_info['raw_name'];


                   $data['my_box'] .="$video_name was uploaded successfuly <br>";

                      $title=$this->input->post('title');

                      $insert = array(
                       'lid' => "$lid" ,
                          'title' => "$title" ,
                         'video_type' => "local_file" ,
                         'video'=>"$video_name"
                      );

                    $this->db->insert('local_videos', $insert);

               }
                else{
               $data['my_box'].= "shajze";
                   $error=$this->upload->display_errors('<p>', '</p>');
                     $data['my_box'].=$error;


               }
















           }












           $this->load->view('admin_panel',$data);


  }

Why I get the file type you are trying to upload is not allowed?


Messages In This Thread
Video Uploading Problem - by El Forum - 07-14-2008, 12:03 AM
Video Uploading Problem - by El Forum - 07-14-2008, 03:18 AM
Video Uploading Problem - by El Forum - 07-14-2008, 04:27 AM
Video Uploading Problem - by El Forum - 07-14-2008, 04:32 AM
Video Uploading Problem - by El Forum - 07-18-2008, 12:24 AM
Video Uploading Problem - by El Forum - 07-18-2008, 02:55 AM
Video Uploading Problem - by El Forum - 07-18-2008, 03:28 AM
Video Uploading Problem - by El Forum - 07-18-2008, 06:13 AM
Video Uploading Problem - by El Forum - 07-18-2008, 10:51 AM
Video Uploading Problem - by El Forum - 07-15-2009, 12:53 AM
Video Uploading Problem - by El Forum - 07-15-2009, 05:05 AM
Video Uploading Problem - by El Forum - 07-15-2009, 05:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB