3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
8 Ext.onReady(function(){
12 var msg = function(title, msg){
23 var fibasic = new Ext.ux.form.FileUploadField({
29 text: 'Get File Path',
30 renderTo: 'fi-basic-btn',
32 var v = fibasic.getValue();
33 msg('Selected File', v && v != '' ? v : 'None');
37 var fbutton = new Ext.ux.form.FileUploadField({
38 renderTo: 'fi-button',
41 'fileselected': function(fb, v){
42 var el = Ext.fly('fi-button-msg');
43 el.update('<b>Selected:</b> '+v);
59 var fp = new Ext.FormPanel({
64 title: 'File Upload Form',
66 bodyStyle: 'padding: 10px 10px 0 10px;',
77 xtype: 'fileuploadfield',
79 emptyText: 'Select an image',
84 iconCls: 'upload-icon'
90 if(fp.getForm().isValid()){
92 url: 'file-upload.php',
93 waitMsg: 'Uploading your photo...',
94 success: function(fp, o){
95 msg('Success', 'Processed file "'+o.result.file+'" on the server');
103 fp.getForm().reset();