我想使用 extjs6 现代工具包上传文件。因此我MessageBox
用文件选择器显示一个。单击“确定”按钮上传(例如通过 HTTP POST)后,如何将所选文件检索到 javascript 对象中?
this.createUploadMsgBox("File Upload", function (clickedButton) {
if (clickedButton == 'ok') {
console.log("file: " + file);
}
createUploadMsgBox: function (title, callback) {
Ext.Msg.show({
title: title,
width: 300,
buttons: Ext.MessageBox.OKCANCEL,
fn: callback,
items: [
{
xtype: 'filefield',
label: "File:",
name: 'file'
}
]
});
}
你可以在这里朗姆我的例子: