PDA

View Full Version : help with file upload



andryi
21 Aug 2009, 1:04 PM
Hi all, can someone help me in file upload, I've this:



var top2 = new Ext.FormPanel({
// renderTo: 'fi-form',
fileUpload: true,
width: 500,
frame: true,
title: 'File Upload Form',
autoHeight: true,
bodyStyle: 'padding: 10px 10px 0 10px;',
labelWidth: 50,
defaults: {
anchor: '95%',
allowBlank: false,
msgTarget: 'side'
},
items: [{
xtype: 'textfield',
fieldLabel: 'Name'
},{
xtype: 'fileuploadfield',
id: 'form-file',
emptyText: 'Select an image',
fieldLabel: 'Photo',
name: 'photo-path',
buttonText: '',
buttonCfg: {
iconCls: 'upload-icon'
}
}],
buttons: [{
text: 'Save',
handler: function(){
if(top2.getForm().isValid()){
top2.getForm().submit({
// url: 'file-upload.php',
url:'C:\\',
waitMsg: 'Uploading your photo...',
success: function(top2, o){
msg('Success', 'Processed file "'+o.result.file+'" on the server');
},
failure: function(top2,o){
msg('Error','no se cargo archivo');
}
});
}
}
},{
text: 'Reset',
handler: function(){
top2.getForm().reset();
}
}]
});

top2.render(document.body);


I want to copy one file to C but , I don't know how