此代码未上传任何文件,表示您未选择任何文件。任何人都可以告诉错误/错误。
public function upload_gallery() {
$config['upload_path'] = 'gallery/';
$config['allowed_types'] = 'jpg|png';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$config['max_size'] = '1024';
$config['encrypt_name'] = true;
$this -> load -> library('upload', $config);
foreach($_FILES['gallery']['name'] as $images => $key) {
if(!$this -> upload-> do_upload('gallery[]')) {
echo $this -> upload -> display_errors();
exit();
}
else {
echo $_FILES['gallery[]']['name'] = $_FILES['gallery']['name'][$images];
$uploaded = $this -> upload -> data();
}
}
}
答案 0 :(得分:0)
您可能正在上传较大的文件,而不是您允许上传的文件。 试试这个或类似的东西:
$config['max_width'] = '4000';
$config['max_height'] = '4000';
$config['max_size'] = '700000';