Welcome Guest, Not a member yet? Register   Sign In
Problem of upload
#1

[eluser]mikevu[/eluser]
Hello everyone,
Now I have a issue with my project is upload file.
this is my code
Code:
$config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'txt|doc|pdf|gif|jpg|png';
        //$config['allowed_types'] = 'doc|pdf';
        $config['max_size']    = '5120';
        $config['remove_spaces']  = true;
        
        $this->load->library('upload', $config);
          $this->upload->initialize($config);
        if ( !$this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());
            $row['result'] = 0;
            echo json_encode($row);
        }    
        else
        {
            $data = $this->upload->data();
            $full_path = $data['full_path'];
            ..
I can upload pdf, txt, gif and jpg file. But I can't upload doc file or png file.
anyone help me?
Thank you very much.
#2

[eluser]überfuzz[/eluser]
Do you have the right mime type? Insert a line in your code that shows what mime-type the browser is sending.
#3

[eluser]mikevu[/eluser]
Hey man,
Thank you so much, It is working well




Theme © iAndrew 2016 - Forum software by © MyBB