CodeIgniter Forums
can not upload flv file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: can not upload flv file (/showthread.php?tid=12822)



can not upload flv file - El Forum - 11-01-2008

[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


can not upload flv file - El Forum - 11-01-2008

[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')