我试图从extjs上传文件到PHP。该文件正常上传,但用户界面卡住,并引发以下错误:未捕获您正在尝试解码和无效的JSON字符串:extjs文件上传无效JSON响应
我已搜索并找到将content-type标题设置为text/html的建议,但那没用。这里是我的代码:
xtype:'form',
width:300,
bodyPadding:5,
frame:false,
items: [{
xtype: 'filefield',
name: 'csv',
msgTarget: 'side',
allowBlank: false,
buttonOnly:true,
anchor: '100%',
buttonText: 'Import CSV',
listeners: {
'change': function(fb,v){
var form = this.up('form').getForm();
form.submit({
url:'/Portal/parsecsv.php',
standardSubmit:false,
method:'PUT'
})
}
}
}]
在parsecsv.php,我只是有:
<?php header('Content-type:text/html');?>
请协助。
确定添加标签是ExtJS而不是浏览器? –