dongyi9484 2019-05-27 18:13
浏览 81

使用dropzone和codeigniter上传多个文件

I'm working on small project using codeigniter and dropzone my script works fine, my only issue is that codeigniter upload just one file since I select multiple files using dropzone.

This is my PHP code:

$config['upload_path']    = FCPATH.'public/uploads/';
$config['allowed_types']  = 'gif|jpg|png';
$config['overwrite']      = true;
$this->load->library('upload', $config);
$this->upload->initialize($config);

if ( ! $this->upload->do_upload('file'))
{
    print_r($this->upload->display_errors());
}

This is error message that I get:

Message: is_uploaded_file() expects parameter 1 to be string, array given

  • 写回答

1条回答 默认 最新

  • douqiao5440 2019-05-27 21:44
    关注

    Your code isn't set up to process multiple files in 1 request. Hence the error as CI doesn't know what to do when $_FILES contains more than 1.

    You can resolve this by making sure that the Dropzone settings match your code. Make sure uploadMultiple is false and parallelUploads is 1.

    评论

报告相同问题?

悬赏问题

  • ¥15 CSS实现渐隐虚线边框
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题