3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 'Ext.form.field.File',
18 'Ext.window.MessageBox'
21 Ext.onReady(function(){
23 var msg = function(title, msg) {
34 var fibasic = Ext.create('Ext.form.field.File', {
40 Ext.create('Ext.button.Button', {
41 text: 'Get File Path',
42 renderTo: 'fi-basic-btn',
44 var v = fibasic.getValue();
45 msg('Selected File', v && v != '' ? v : 'None');
49 Ext.create('Ext.form.field.File', {
50 renderTo: 'fi-button',
54 'change': function(fb, v){
55 var el = Ext.get('fi-button-msg');
56 el.update('<b>Selected:</b> '+v);
62 afteranimate: function() {
75 Ext.create('Ext.form.Panel', {
79 title: 'File Upload Form',
80 bodyPadding: '10 10 0',
95 emptyText: 'Select an image',
100 iconCls: 'upload-icon'
107 var form = this.up('form').getForm();
110 url: 'file-upload.php',
111 waitMsg: 'Uploading your photo...',
112 success: function(fp, o) {
113 msg('Success', 'Processed file "' + o.result.file + '" on the server');
120 handler: function() {
121 this.up('form').getForm().reset();