Welcome Guest, Not a member yet? Register   Sign In
I think the code is correct. But.........

Here is my code in processing file upload :
class Ungxu extends Controller
  function Ungxu()
function index()
       $this->load->view('ungxu', array('error' => ' ' ));// pass error argument
       // attach file upload (if have)
function doUpload()
        $config['upload_path'] = '/uploads/ungxu/';
        $config['allowed_types'] = 'doc|txt|rar';
        $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());
                $data['content'] = $this->load->view('dangky', $error, true);
                $upload_data = $this->upload->data();
                $filename = $upload_data['file_name'];

and view:
    &lt;?=form_open_multipart('ungxu/doUpload'); ?&gt;

      <td style="width: 198px">
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Tài liệu đính kèm</td>
      <td>&lt;input name="filename" type="file" id="filename" /&gt; (Tối đa 1MB)</td>
    <td align="center" colspan="2">
     &lt;input type="submit" name="submit" value="Gửi" id="send" style="width:70px;"
&lt;input type="reset" value="Làm lại" /&gt;                            
My idea is if a visitor upload a file and webpages will automatically attach file to send mail. But when i try it, an error generated:
Quote:An Error Was Encountered
Unable to load the requested language file: language/upload_lang.php
My code have some problems? Please tell me how can resolve it? Thank you..

It looks like a file is missing in your CI system's language folder: upload_language.php. It's part of the core and contains the messages used for file upload. Look in the system/language folder and see if the file is there. You may have erased it by accident.

Theme © iAndrew 2016 - Forum software by © MyBB