[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