Blueimp Codeigniter图片上传ajax 500内部服务器错误

时间:2016-06-23 13:26:56

标签: php jquery ajax codeigniter blueimp

我正在尝试将blueimp实现到我的codeigniter项目,以便对图像进行多个图像上传。 我面临500(内部服务器错误)我知道如果我们的PHP脚本中有任何错误,就会出现这种情况。 在我的PHP脚本中,我得到的响应为 {“files”:[]} ,以表示我的img_upload文件夹中没有的img。它必须返回null对象,但是

在我的控制台中我收到错误,如下图所示。 enter image description here

当我点击匿名函数时在my.js中将我重定向到下面的函数。

        $.ajax({
        // Uncomment the following to send cross-domain cookies:
        //xhrFields: {withCredentials: true},
        url: $('#fileupload').fileupload('option', 'url'),
        dataType: 'json',
        context: $('#fileupload')[0]
    }).always(function () {
        $(this).removeClass('fileupload-processing');
    }).done(function (result) {
        $(this).fileupload('option', 'done')
            .call(this, $.Event('done'), {result: result});
    });

我在想的是这可能是返回类型html或json的问题,但无法解决此问题。我怎样才能解决这个问题所以我可以上传图像而不会出现内部错误。提前谢谢。

我正在关注以下github wiki,我的代码也是一样的。

This blog

1 个答案:

答案 0 :(得分:1)

may be its php.ini problem

打开php.ini文件

搜索extension = php_fileinfo.dll

如果您使用的是xampp,则默认情况下可以注释

变化

;extension=php_fileinfo.dll

to

extension=php_fileinfo.dll

然后重启你的xampp ......

这解决了我的问题

相关问题