gpt4 book ai didi

php - Jquery 文件上传语法错误 : JSON. 解析:JSON 数据后出现意外的非空白字符

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:41:58 25 4
gpt4 key购买 nike

我想使用产品但是当上传图片时我看到错误

语法错误:JSON.parse:JSON 数据后出现意外的非空白字符

script directory: Folder2
directory Jquery-file-upload: function/blueimp-jQuery-File-Upload/
in main.js i edit rows

$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: 'server/php/'
});

$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: '../function/blueimp-jQuery-File-Upload/server/php/'
});

图片保存在服务器上,但上传后显示错误。

第一步 http://s55.radikal.ru/i149/1211/10/8c8d911589de.jpg

Step2 错误 http://s019.radikal.ru/i604/1211/8c/7e05d92b30ef.jpg

对请求的 furebug 响应

[{"name":"1353755388.jpg","size":879394,"type":"image\/jpeg","url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/files\/1353755388.jpg","thumbnail_url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/files\/thumbnail\/1353755388.jpg","upload_to_db":true,"delete_url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/?file=ExPRoG-1353755388.jpg","delete_type":"DELETE"}]/home/m/malishkaru/public_html/function/blueimp-jQuery-File-Upload/server/php

请告诉我为什么会出现此错误?什么时候出错?

最佳答案

由于结束后的文本,您显示的“对请求的响应”不是有效的 JSON。

如果您可以将 PHP 更改为在结束后不返回所有内容 ] 您将拥有有效的 JSON。

“意外的非空白字符”是/home/m/etc 结束后的/]

我在编写 /home/m/malishkaru/public_html/function/blueimp-jQuery-File-Upload/server/php 时删除了部分代码,一切正常。

附:谢谢nnnnnn

P.P.S.:仅回答关闭问题。用户 nnnnnn 给出了很好的答案。

关于php - Jquery 文件上传语法错误 : JSON. 解析:JSON 数据后出现意外的非空白字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13541107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com