画像をアップロードして、base64文字列のExtJSのリスナーと、ここでいくつかのコードに画像を変換する方法:私はbtoa機能を追加しよう画像アップロード4
xtype: 'filefield',
id: 'image',
emptyText: '-- Choose Image --',
fieldLabel: 'Photo',
name: 'image',
anchor: "82%",
buttonText: 'Browse',
buttonConfig: {
iconCls: ''
},
change: function() {
// this is get component
var valueElement = Ext.getCmp("component_image_upload").getValue();
// function upload image full path and encode to base64
// function here
// result to encode base64
var GenEncoded = valueElement;
Ext.getCmp("component_textarea").setValue(GenEncoded);
それだけで変換FileFieldに上ではなく、画像をアップロードするための文字列:
// result to encode base64
var GenEncoded = btoa(valueElement);
Ext.getCmp("ttransdelivery_module_manualreceive_form_receive_ar_1_general_blk_i_form_text_2031").setValue(GenEncoded);
は、あなたがこのためにFileAPIを使用することができます