Welcome Guest, Not a member yet? Register   Sign In
can not upload flv file
#1

[eluser]Mitja B.[/eluser]
Code:
$config['upload_path'] = './uploads/MOVIE';
$config['allowed_types'] = 'flv';
$config['max_size']    = '10000';
    
$this->load->library('upload', $config);  
$this->upload->initialize($config);

$field_name = "flamovie";
      
if (!$this->upload->do_upload($field_name))
{          
$uploads = $this->upload->data();  
echo $uploads['file_ext'];

$data['error_fla'] = $this->upload->display_errors('<div class="warning">', '</div>');
                            
$this->load->view('admin/content_add', $data);
return;
}    
else
{
...

echo $uploads['file_ext'] give me .flv but i get all the time error of
The filetype you are attempting to upload is not allowed

what is wrong? if i change allowed_types to jpg and upload jpg works. Problem is only with flv

EDIT

i try this
Code:
// For Debugging
echo "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>";
}

and i get

Mime uploaded: application/octet-stream
allowed:

boolean false
#2

[eluser]pistolPete[/eluser]
FLV is not included in system/application/config/mimes.php.
You can fix this by adding this to the mimes array:

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




Theme © iAndrew 2016 - Forum software by © MyBB