Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何在blueimp图像上传器中以逗号sepreated获取上传图像的名称_Jquery_Jquery Plugins - Fatal编程技术网

Jquery 如何在blueimp图像上传器中以逗号sepreated获取上传图像的名称

Jquery 如何在blueimp图像上传器中以逗号sepreated获取上传图像的名称,jquery,jquery-plugins,Jquery,Jquery Plugins,我需要所有的图像名称以逗号分隔。Bcoz我需要以逗号分隔的形式在数据库中插入名称 我试图在handle_file_upload()函数中处理这个问题 $arrOfImgs=array($file->name); $comma_separated=内爆(“,”,$arrOfImgs) 把这个交上来 $file->upload\u to\u db=$this->add\u img($逗号分隔) 但是失败了 请帮帮我 protected function handle_file_upload($upl

我需要所有的图像名称以逗号分隔。Bcoz我需要以逗号分隔的形式在数据库中插入名称

我试图在handle_file_upload()函数中处理这个问题

$arrOfImgs=array($file->name); $comma_separated=内爆(“,”,$arrOfImgs)

把这个交上来

$file->upload\u to\u db=$this->add\u img($逗号分隔)

但是失败了

请帮帮我

protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,

        $index = null, $content_range = null) {

        $file = new stdClass();

        $file->name = $this->trim_file_name($name, $type, $index, $content_range);

        $arrOfImgs = array($file->name);

        $comma_separated = implode(",", $arrOfImgs);

        $file->size = $this->fix_integer_overflow(intval($size));

        $file->type = $type;

        if ($this->validate($uploaded_file, $file, $error, $index)) {
            $this->handle_form_data($file, $index);
            $upload_dir = $this->get_upload_path();
            if (!is_dir($upload_dir)) {
                mkdir($upload_dir, $this->options['mkdir_mode'], true);
            }
            $file_path = $this->get_upload_path($file->name);
            $append_file = $content_range && is_file($file_path) &&
                $file->size > $this->get_file_size($file_path);
            if ($uploaded_file && is_uploaded_file($uploaded_file)) {
                // multipart/formdata uploads (POST method uploads)
                if ($append_file) {
                    file_put_contents(
                        $file_path,
                        fopen($uploaded_file, 'r'),
                        FILE_APPEND
                    );
                } else {
                    move_uploaded_file($uploaded_file, $file_path);
                }
            } else {
                // Non-multipart uploads (PUT method support)
                file_put_contents(
                    $file_path,
                    fopen('php://input', 'r'),
                    $append_file ? FILE_APPEND : 0
                );
            }
            $file_size = $this->get_file_size($file_path, $append_file);
            if ($file_size === $file->size) {
                if ($this->options['orient_image']) {
                    $this->orient_image($file_path);
                }
                $file->url = $this->get_download_url($file->name);
                foreach($this->options['image_versions'] as $version => $options) {
                    if ($this->create_scaled_image($file->name, $version, $options)) {
                        if (!empty($version)) {
                            $file->{$version.'_url'} = $this->get_download_url(
                                $file->name,
                                $version
                            );
                        } else {
                            $file_size = $this->get_file_size($file_path, true);
                        }
                    }
                }
            } else if (!$content_range && $this->options['discard_aborted_uploads']) {
                unlink($file_path);
                $file->error = 'abort';
            }

            $file->upload_to_db = $this->add_img($comma_separated);

            $file->size = $file_size;
            $this->set_file_delete_properties($file);
        }
        return $file;
    }

这是一个php问题,而不是jquery,因为它现在被标记了