extjs 上传图片怎么判断图片的大小和分辨率?
Ext.create('Ext.form.Panel', { title: 'Upload a Photo', width: 400, bodyPadding: 10, frame: true, renderTo: Ext.getBody(), items: [{ xtype: 'filefield', name: 'photo', fieldLabel: '上传轮播图', labelWidth: 70, msgTarget: 'side', allowBlank: false, emptyText : '请选择图片', anchor: '95%', buttonText: '选择文件' }], });
<input type= 'file' name = 'upload' id = 'upload'>
var dom = document.getElementById('upload');
var fileSize = dom.files[0].size;//文件的大小,单位为字节B
我是这样创建的
Ext.create('Ext.form.Panel', { title: 'Upload a Photo', width: 400, bodyPadding: 10, frame: true, renderTo: Ext.getBody(), items: [{ xtype: 'filefield', name: 'photo', fieldLabel: '上传轮播图', labelWidth: 70, msgTarget: 'side', allowBlank: false, emptyText : '请选择图片', anchor: '95%', buttonText: '选择文件' }], });