2015-08-19 89 views
0

我想上傳大小爲2.89KB的文件。當我上傳文件時,錯誤是您嘗試上傳的文件大於允許的大小,文件上傳過程中出錯

您試圖上傳的文件大於允許的 大小。

這裏是我的代碼供參考。

$config['upload_path'] = './uploads/'; 
      $config['allowed_types'] = 'gif|jpg|png|xls'; 
      $config['max_size'] = ''; 
      $config['max_width'] = ''; 
      $config['max_height'] = ''; 

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

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

       $this->load->view('uploadstatement',$error); 
      } 
      else 
      { 
    $data = array('upload_data' => $this->upload->data()); 
    $data1=$this->upload->data(); 
    $file=$data1['file_name']; 
+0

我想max_size不應該是'',你應該在HtML中設置最大尺寸... –

+0

非常感謝....我知道了 – manjusha

+0

我明白了。謝謝先生 – manjusha

回答

2

儘量仔細檢查你的php.ini這以下內容:

「/xampp/php/php.ini」 //你的XAMPP文件夾

upload_max_filesize=2M 
post_max_size=8M 
相關問題