Lok*_*oki 5 php jquery file-upload
我想使用产品但是当上传图片时我看到错误
SyntaxError: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/'
});
Run Code Online (Sandbox Code Playgroud)
上
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: '../function/blueimp-jQuery-File-Upload/server/php/'
});
Run Code Online (Sandbox Code Playgroud)
图像true保存在服务器上,但在上传后显示错误.
Step1 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
Run Code Online (Sandbox Code Playgroud)
告诉我,为什么我有这个错误?出错时?
由于结束 ] 后的文本,您显示的“对请求的响应”不是有效的 JSON。
如果您可以将 PHP 更改为在结束后不返回所有内容],您将拥有有效的 JSON。
“意外的非空白字符”是 /home/m/etc 中结束后的 / ]
我在写入/home/m/malishkaru/public_html/function/blueimp-jQuery-File-Upload/server/php时删除了部分代码,并且一切正常。
PS:谢谢nnnnnn。
PPS:仅回答封闭问题。用户nnnnnn给出了很好的答案。