开发者

Upload problem in CodeIgniter

开发者 https://www.devze.com 2023-04-04 14:10 出处:网络
I am getting this error: The upload destination folder does not appear to be writable. But is_dir and is_writable both return true.

I am getting this error:

The upload destination folder does not appear to be writable.

But is_dir and is_writable both return true.

$config['upload_path'] = './work_order_doc/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size']= '100';
$config['max_width']  = '1024';
$config['max_hei开发者_JAVA技巧ght']  = '768';
$this->load->library('upload', $config);
$work_order_file="work_order_file";

var_dump(is_dir($config['upload_path']));
var_dump(is_writable($config['upload_path']));



if ( ! $this->upload->do_upload($work_order_file))
   {
     $error = array('error' => $this->upload->display_errors());
     print_r($error);
     $temp="";
     }
else
 {
   $upload_data = $this->upload->data();
   echo $temp=$upload_data['file_name'];
}


Maybe your host have blocked file uploads? You can always try to specify full path to the upload directory.


Your PHP configuration may be not allowing you to get to the file/directory, try checking open_basedir in php.ini and make sure it is in allowed paths.

0

精彩评论

暂无评论...
验证码 换一张
取 消