2016-12-31 58 views
0

我用簡單的CI文件上傳類,它的工作原理罰款的LocalServer但它轉移到生產服務器時,它不工作,它只是說頁面不響應..Codeiginitor do_upload給生產服務器上的錯誤

可以在任何在這一個幫助..

請檢查我的代碼

<?php 

class Upload extends CI_Controller { 

     public function __construct() 
     { 
       parent::__construct(); 
       $this->load->helper(array('form', 'url')); 
     } 

     public function index() 
     { 
       $this->load->view('upload_form', array('error' => ' ')); 
     } 

     public function do_upload() 
     { 
       $config['upload_path']   = './assets/'; 
       $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('userfile')) 
       { 
         $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); 
       } 
     } 
} 
?> 

回答

0

你需要設置文件權限您上傳的圖片一個目標目錄爲777