Welcome Guest, Not a member yet? Register   Sign In
Upload FLV to my server
#1

[eluser]Unknown[/eluser]
Hi, i;m new on codeigniter, i've upload my project into a website, now i confused when i try it on xampp upload FLV works fine but when i upload on server it read as a text-plain,

here's my code :

Code:
if (!empty($_FILES['userfile']['name'])) {
                $dt = date("YmdHis") . substr((string) microtime(), 1, 8);
                $dte = explode(".", $dt);
                $nama = $dte[0] . $dte[1];
                $nv = $_FILES['userfile']['name'];
                $nvi = explode(".", $nv);
                $nvext = $nvi[1];
                $namavideo = "video_" . $nama . "." . $nvext;
                $configVideo['upload_path'] = 'assets/video/';
                $configVideo['allowed_types'] = 'avi|flv|wmv|mp3|mp4';
                $configVideo['overwrite'] = FALSE;
                $configVideo['remove_spaces'] = TRUE;
                $configVideo['file_name'] = $namavideo;

                $this->load->library('upload', $configVideo);
                $this->upload->initialize($configVideo);
                $file_size = $_FILES['userfile']['size'];
                $type = $_FILES['userfile']['type'];
                if (!$this->upload->do_upload('userfile')) {
                    $videoDetails = $this->upload->data();
                } else {
                    
                }
            } else if (empty($_FILES['userfile']['name'])) {
                $file_size = 20000;
                $type = "video/x-flv";
                $namavideo = "video_";
            }

i also add code to my mimes :

Code:
'flv' => array('video/flv', 'video/x-flv', 'flv-application/octet-stream', 'application/octet-stream'),

and htaccess

Code:
AddType video/x-flv .flv

but still i can't upload the video format FLV, somebody can help me
the error message "The filetype you are attempting to upload is not allowed." , but it works fine with JPEG, MP3 but when video files it read as a plain-text




Theme © iAndrew 2016 - Forum software by © MyBB