I have made code for the uploading multiple files in the php and its workign fine. But what i need is to implement in the codeigniter. Is it possible to use same code or i have to follow code of the codeigniter? I am good in php but new to codeigniter, please help me to solve this problem. Thanks in advance.
Have you done object oriented PHP code before? Basically you can use your code with codeigniter with no problem, it is simply a framework to give you useful functions and classes which you should use if creating a website with the framework. You could create a class with the upload function which can then easily be called when uploading needs to be done. class SomeClass { function Upload($params) { //paste your function and do something with params } } PHP:
You would simply initialize the upload library, and call the do_upload() function. function do_upload() { $config['upload_path'] = './uploads/'; $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()); $this->load->view('upload_form', $error); } else { $data = array('upload_data' => $this->upload->data()); $this->load->view('upload_success', $data); } } Code (markup):