You did not select a file to upload. PHP Code Igniter

I am trying to implement a post functionality and want to pick message and image from a php view. My message functionality is working good. But on image upload i receive an error You did not select a file to upload. This is my controller function

function post_func()
    echo $post_message=$_POST['post'];
    echo $share_with=$_POST['share_with'];
    echo $image=$_POST['image'];
        echo "<br/>no image<br/>";  

            $config['upload_path'] = './application/css';
            $config['allowed_types'] = 'gif|jpg|png';
            $config['max_size'] = '100';
            $config['max_width']  = '1024';
            $config['max_height']  = '768';

            $this->load->library('upload', $config);


            if ( ! $this->upload->do_upload())
                $error = array('error' => $this->upload->display_errors());

                echo "<br/>";
                echo $this->upload->display_errors();
                echo "<br/> image error<br/>";

                echo "<br/> reached <br/>";
                $data = array('upload_data' => $this->upload->data());

                echo "<br/ problem<br/>";

        echo "1";
        echo "0";
    }echo "-----------------------------<br/>";
    echo $user=$this->session->userdata('user_identification');
    $data = array 
                'userid'=> $user,
                'public' => $public,
                'message' => $post_message,
                'picname' => "None"
    echo "</br>";
    echo $user=$this->session->userdata('user_identification');

This is my view.

<?php echo form_open('search/post_func');?>

<!--<form id="loginForm" action="../search/post_func" method="post" enctype="multipart/form-data" >-->
<div id="your_post">
<div id="post_image">
<img   id ="post_img" src="<?php  echo $this->config->item('base_url'); ?><?php echo '/application/css/'. $img ?>"/>
<textarea name="post" rows="5" cols="30" placeholder="Share an update..." id="post_text" rows="2" value=""></textarea>

//other view items
    echo form_close();

Please help me



<?php echo form_open_multipart('search/post_func');?>



To this:


and it will work!! :)

Need Your Help

Train and Test file for SVM light

machine-learning svm svmlight

I am trying to use SVM for a text classification problem. I have found an SVM implementation called SVM light and its derivative SVM multiclass (for classification problems with more than 2 classes).

MySQL table with 4,000,000 record?

php mysql sql geospatial

The website I have to manage is a search engine for worker (yellow page style)