与其它库类似,你将根据你的偏好设置来控制要被上传的文件,在控制器里,你建立了如下的偏好设置:[code]$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);
// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
//【如果你在 config文件夹内的 autoload.php 文件中自动加载了 upload 类,或者在构造函数内加载了的话,可以调用初始化函数 initialize 来加载设置。————本括号内由IT不倒翁翻译,加入了自己的理解】
$this->upload->initialize($config);[/code]以上偏好设置将被完全执行。以下是所有偏好设置参数的描述。
文章来源:http://cwiki.ossez.com/pages/viewpage.action?pageId=2392149