• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Video Uploading

#1
[eluser]soijiro[/eluser]
Hi guys,
i got problem when i try to upload videos file (in other case it works such jpg, png, mp3).

here's my controller
Code:
$this->img_config['upload_path'] = $this->dir;
            $this->img_config['max_size'] = '20000000';
            $this->img_config['overwrite'] = TRUE;
            $this->img_config['allowed_types'] = 'mpeg|mp3|flv';
            $this->upload->initialize($this->img_config); //initiate the upload library

            if(is_array($_FILES) && !empty($_FILES))
            {
                if ( ! $this->upload->do_upload()) {
                    echo $this->upload->display_errors();
                }
                else {
                    $data = array('upload_data' => $this->upload->data());
                    $image_data = $this->upload->data();
                }
            }else{
                ;
            }
            echo var_dump($this->upload->data());
            // For Debugging
            echo "<br/>Mime uploaded: ".$this->upload->file_type."<br>";
            foreach ($this->upload->allowed_types as $val)
            {
                echo "allowed: "; var_dump($this->upload->mimes_types(strtolower($val))); echo "<br>";
            }

i try to debug when uploading video file (.mpeg).
Code:
array(14) { ["file_name"]=> string(0) "" ["file_type"]=> string(0) "" ["file_path"]=> string(7) "./data/" ["full_path"]=> string(7) "./data/" ["raw_name"]=> string(0) "" ["orig_name"]=> string(0) "" ["client_name"]=> string(0) "" ["file_ext"]=> string(0) "" ["file_size"]=> string(0) "" ["is_image"]=> bool(false) ["image_width"]=> string(0) "" ["image_height"]=> string(0) "" ["image_type"]=> string(0) "" ["image_size_str"]=> string(0) "" } Mime uploaded:
allowed: string(10) "video/mpeg"
allowed: array(4) { [0]=> string(10) "audio/mpeg" [1]=> string(9) "audio/mpg" [2]=> string(11) "audio/mpeg3" [3]=> string(9) "audio/mp3" }
allowed: array(2) { [0]=> string(11) "video/x-flv" [1]=> string(24) "application/octet-stream" }

but when i try to upload mp3 file it is work perfectly
Code:
array(14) { ["file_name"]=> string(32) "Adele+-+Set+Fire+To+The+Rain.mp3" ["file_type"]=> string(9) "audio/mp3" ["file_path"]=> string(32) "C:/xampp/htdocs/project/eo/data/" ["full_path"]=> string(64) "C:/xampp/htdocs/project/eo/data/Adele+-+Set+Fire+To+The+Rain.mp3" ["raw_name"]=> string(28) "Adele+-+Set+Fire+To+The+Rain" ["orig_name"]=> string(32) "Adele+-+Set+Fire+To+The+Rain.mp3" ["client_name"]=> string(32) "Adele+-+Set+Fire+To+The+Rain.mp3" ["file_ext"]=> string(4) ".mp3" ["file_size"]=> float(5819.98) ["is_image"]=> bool(false) ["image_width"]=> string(0) "" ["image_height"]=> string(0) "" ["image_type"]=> string(0) "" ["image_size_str"]=> string(0) "" } Mime uploaded: audio/mp3
allowed: string(10) "video/mpeg"
allowed: array(4) { [0]=> string(10) "audio/mpeg" [1]=> string(9) "audio/mpg" [2]=> string(11) "audio/mpeg3" [3]=> string(9) "audio/mp3" }
allowed: array(2) { [0]=> string(11) "video/x-flv" [1]=> string(24) "application/octet-stream" }

i've checked mime, and i found what the mime for the ext what i set allowed.
so, it is supposed to be work, i think.

the problem when i upload .flv, .mpeg file, it show empty.

Regards,
Soijiro


Messages In This Thread
Problem with Video Uploading - by El Forum - 06-04-2012, 06:19 AM
Problem with Video Uploading - by El Forum - 06-04-2012, 06:28 AM
Problem with Video Uploading - by El Forum - 06-04-2012, 06:32 AM
Problem with Video Uploading - by El Forum - 06-04-2012, 06:35 AM
Problem with Video Uploading - by El Forum - 06-04-2012, 06:38 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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