我在 Ext JS 3.3.1 中使用 Ext.ux.FileUploadField。我需要从表单中获取文件数据。有谁知道不提交表格是否可行?我可以看到文件名,但看不到文件数据...
谢谢。
我在 Ext JS 3.3.1 中使用 Ext.ux.FileUploadField。我需要从表单中获取文件数据。有谁知道不提交表格是否可行?我可以看到文件名,但看不到文件数据...
谢谢。
// get a handle to the FileUploadField component (e.g. by ID)
var fp = Ext.getCmp('fileUploadField');
//add a handler to FileUploadField's fileselected event
fp.on('fileselected', this.onFileUploadFieldFileSelected, this);
// 'fileselected' event handler
onFileUploadFieldFileSelected : function(fp, fileName) {
// get a handle to the selected file
var selectedFile = fp.fileInput.dom.files[0];
// read the contents of the file using FileReader and display content here
}