【发布时间】:2017-05-03 16:56:44
【问题描述】:
我需要上传多张图片,我阅读了很多不起作用的文档,我看到了这个:
我按照他们所说的做了,当我在我的视图中调用他们的控制器“multiuploader”时,它工作得很好,但是,当我在自己的控制器中使用时,它就不起作用了。它将图像保存到数据库和文件夹中,但我看不到表单中的任何内容,例如添加中的图像或列表中的链接,即使我之前使用“multiuploader”保存在同一个表中也是如此。
如果你能帮助我,我很感激。提前致谢。
这是我的控制器。
public function Test() {
$this->crud = new Grocery_CRUD_Multiuploader();
$this->crud->set_table('multi_uploader_gallery');
$this->crud->set_subject('Document');
$this->crud->fields("title", "my_pictures", "my_files", "my_mail_attachments");
$this->crud->columns("title", "my_pictures", "my_files", "my_mail_attachments");
$config = array(
/* Destination directory */
"path_to_directory" => 'assets/test',
/* Allowed upload type */
"allowed_types" => 'gif|jpeg|jpg|png',
/* Show allowed file types while editing ? */
"show_allowed_types" => true,
/* No file text */
"no_file_text" => 'No Pictures',
/* enable full path or not for anchor during list state */
"enable_full_path" => false,
/* Download button will appear during read state */
"enable_download_button" => true,
/* One can restrict this button for specific types... */
"download_allowed" => 'jpg'
);
$this->crud->new_multi_upload("my_pictures", $config);
$output = $this->crud->render();
$data['contents'] = 'contents';
$data = array_merge($data, (array) $output);
$this->load->view('template', $data);
}
当我使用我的视图但示例表没有显示任何错误,但当我使用我的表时它显示:
【问题讨论】:
-
您是否遇到任何错误?你看过错误日志吗?
-
在视图中我没有看到任何错误。我在哪里寻找错误日志?
-
当我使用我的视图但示例表没有显示任何错误,但是当我使用我的表时它显示
标签: php codeigniter file-upload multi-upload