0

我在 Ext JS 3.3.1 中使用 Ext.ux.FileUploadField。我需要从表单中获取文件数据。有谁知道不提交表格是否可行?我可以看到文件名,但看不到文件数据...

谢谢。

4

1 回答 1

1
// 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
}
于 2013-03-07T23:53:46.637 回答