Welcome Guest, Not a member yet? Register   Sign In
uploadin pdf, eps,cdr type file error in firfox
#1

[eluser]praveens[/eluser]
hi up to today it was working fine but today not working uploadin pdf, eps,cdr type file showing error like The filetype you are attempting to upload is not allowed in firefox but it working in internet explorer can any one give solution
#2

[eluser]xwero[/eluser]
You need to use php code to see the mime
Code:
echo $_FILES['userfile']['type']
And check if the mime type is present in the config/mimes.php file for that extension. If it isn't you add it and then it should work.
#3

[eluser]praveens[/eluser]
ya i checked already in mime its there but its not working
#4

[eluser]xwero[/eluser]
can you show your upload code?
#5

[eluser]praveens[/eluser]
controller code
Code:
function update_vectors()
    {
        if($this->session->userdata('user_id'))
        {
            $this->pre_update_vectors();
            
            $arr_data['vectorresults']    =    $this->adminmodel->getvector();
            
            if($this->validation->run() == FALSE)
            {
                $arr_data['custom_message']=" ";
                $this->load->view('admin/update_vector',$arr_data);    

            }
            else
            {
                if($err = $this->_add_vector())
                {
                    $arr_data['uploadError'] = $err;
                    $this->load->view('admin/update_vector',$arr_data);
                }
            }
        }
        else
        {
            redirect('users/login');
        }
    }
    
    function pre_update_vectors()
    {
        $rules['vectornameid'] = "trim|required|xss_clean";
        $rules['instruction'] = "trim|required|xss_clean";
        $this->validation->set_rules($rules);
            
        $fields['vectornameid']="Vector Name";
        $fields['instruction'] ="Instruction";
        $this->validation->set_fields($fields);

    }
    
    function _add_vector()
    {
        $config['allowed_types']     = 'png|pdf|jpg|bmp|gif|psd|eps|cdr|zip|txt';
        $config['upload_path']         = './uploads/adminaddedvectors';
        $config['max_size']         = '10000';
        $this->load->library('upload', $config);
        
        //echo $_FILES['userfile']['type'] ;

                
        if (!$this->upload->do_upload('userfile'))
        {
            return $this->upload->display_errors();
        }
        else
        {
            $file_upload = $this->upload->data();
            $filename = $file_upload['file_name'];
                    
            $arr_data = $this->adminmodel->update_admin_vector($filename);  /* call model function to update records*/
            $this->send_mail();
            redirect('admin/update_vectors','refresh');
        }
    }
#6

[eluser]ontguy[/eluser]
I think it has to do with how the browser is handling the mime.

Do all file type give that error or only certain ones? Is the output for this the same in both browsers?
Code:
echo $_FILES['userfile']['type']

This thread may help resolved the issue: http://ellislab.com/forums/viewthread/77138/
#7

[eluser]praveens[/eluser]
solved it was browser problem thanks for support




Theme © iAndrew 2016 - Forum software by © MyBB