首页 新闻 赞助 找找看

extjs 上传图片怎么判断图片的大小和分辨率?

0
悬赏园豆:50 [已关闭问题] 关闭于 2016-04-22 11:15

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: '选择文件'
    }],
});
一壶烧开的水的主页 一壶烧开的水 | 初学一级 | 园豆:156
提问于:2016-04-01 16:51
< >
分享
所有回答(1)
0

<input type= 'file' name = 'upload' id = 'upload'>

var dom = document.getElementById('upload');
var fileSize = dom.files[0].size;//文件的大小,单位为字节B

Rich.T | 园豆:3440 (老鸟四级) | 2016-04-01 16:54

我是这样创建的

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: '选择文件'
    }],
});
支持(0) 反对(0) 一壶烧开的水 | 园豆:156 (初学一级) | 2016-04-01 17:17
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册