uploadfilefield
에서 파일 내용을 가져 오려고 시도 중입니다. ExtJS4을 사용하고 있지만 어떻게 알 수 있습니까? 나는 어쩌면 fb
는 내용이 생각했지만, alert(JSON.stringify(fb))
나에게 원형 객체 인 fb
에 대한 오류를 제공uploadfilefield에서 파일 내용을 가져 오는 방법은 무엇입니까?
{
xtype: 'fileuploadfield',
buttonText : 'Upload CSV',
buttonConfig:
{
icon: 'images/upload.png',
tooltip:
{
text: 'some hints',
width: 200
}
},
buttonOnly: true,
listeners:
{
'change': function(fb, v)
{
// v returns the filename
// HOW CAN I GET THE FILE CONTENT?
}
}
}
:
나는 uploadfilefield
이 코드가 있습니다.
나는 다른 방법/이벤트가 있어야한다고 생각합니다. 또한 대화 상자에서 열기를 누른 후 바로 파일 내용을 가져 오려고합니다. 나중에 이렇게하려면 제출 버튼을 사용할 수 없습니다.
감사 동료 StackOverflowers)
부록 :
내가 센차에이 EXAMPLE에서 찾고 있어요 : '사진 업로드에 전달되는 어떤
Ext.create('Ext.form.Panel', {
title: 'Upload a Photo',
width: 400,
bodyPadding: 10,
frame: true,
renderTo: Ext.getBody(),
items: [{
xtype: 'filefield',
name: 'photo',
fieldLabel: 'Photo',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
buttonText: 'Select Photo...'
}],
buttons: [{
text: 'Upload',
handler: function() {
var form = this.up('form').getForm();
if(form.isValid()){
form.submit({
url: 'photo-upload.php',
waitMsg: 'Uploading your photo...',
success: function(fp, o) {
Ext.Msg.alert('Success', 'Your photo "' + o.result.file + '" has been uploaded.');
}
});
}
}
}]
});
. PHP '? 이 PHP가 파일의 내용을 가져 오는 방법은 무엇입니까?
HTML5을 FileReader 당신이 답을 편집 할 수 API –