PDA

View Full Version : How to upload a file with Ajax?



cekimy
16 Jun 2011, 10:31 PM
I used the FileUploadField,but it uploads the file through form.submit?
I have a 'card' layout form,all of the input fields are in the 1st card include a file type field,when i click "Next Step",i just want to upload an Excel to PHP using Ajax,read it and then return the data to display in the 2nd card for the users to confirm it.How can I achieve it?Thanks

proofmoore
16 Jun 2011, 10:51 PM
if you add

defaults: {
xtype: "container",
},

to your card container, you can reach any input from any card.

jarlau
17 Jun 2011, 2:08 AM
read FormPanel (http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=Ext.form.FormPanel) API, and fileUpload (http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=Ext.form.BasicForm&member=fileUpload) config.