PDA

View Full Version : Take a File or Image with Ajax Call



ladro1987
20 Jan 2011, 12:59 AM
Hi all!
There is a method for submit a file with Ajax Call??
The submit, work if I send the form with "classic method":


form.getForm().submit({
method:'POST',
waitMsg: 'Salvataggio...',
success: function () {
...
}
failure:function(edit_prodotto_base, action){
...
}
});
While, if I send the form using the Ajax Call, submit all other data exept the file's value.
For example:


Ext.Ajax.request({
waitMsg: 'Attendere Prego...',
url: "page.php",
params: {
task:"action",
subTask:"sub_action",
id: M[0].get('id'),
name: Ext.getCmp('name_isc_agg').getValue(),
image: Ext.getCmp('image_isc_agg').getValue()///this is the file's filed and don't take the value!
},
success: function(response){
...
},
failure: function(response){
...
}

There's a method for take the input file's value using the Ajax Call???

Thanks
Roberto