title: ExtJS 4.2 filefield multiple upload
body: <p>I´m having some troubles with the multi file upload</p>
  
  <p>In my controller I generate a window with a form and the form has a filefield and a grid:</p>
  
  <pre><code>var ventanaSubirDocumento=new Ext.Window({
          title: '&lt;span style="color:#C85E00;"&gt;Subida de Documento&lt;/span&gt;',
          plain: true,
          modal: true,
          frame: true,
          border: false,
          resizable: false,
          draggable: false,
          scope:this,
          items:[
                 {
                     xtype:'form',
                     width: 400,
                     bodyPadding: 10,
                     frame: true,
                     timeout:600000,//Por si pesa mucho el archivo
                     renderTo: Ext.getBody(),
                     items: [{
                         xtype: 'filefield',
                         name: '',
                         fieldLabel: '',
                         fieldStyle:'color:black',
                         labelWidth: '',
                         msgTarget: 'side',
                         allowBlank: false,
                         anchor: '100%',
                         buttonText: 'Seleccionar documento',
                         listeners: {
                             change: function(fld, value) {
                                 //var newValue = value.replace(/C:\\fakepath\\/g, '');
                                 //fld.setRawValue(newValue);
                                 var upload = fld.fileInputEl.dom;
                                 var files = upload.files;
                                 var names = [];
                                 var names2 = [];
  
                                 if (files) {
                                     for (var i = 0; i &lt; files.length; i++){
                                         names.push(files[i].name);
                                         names2.push({archivo:files[i].name})
                                         value = names.join(', ');
                                     }
                                 }
                                 gridDocumentos.getStore().loadData(names2);
                                 fld.setRawValue(value);
                             },
                             /*render:function(field, eOpts){
                                 field.fileInputEl.set({ multiple: true });
                             }*/
                             afterrender:function(cmp){
                                 cmp.fileInputEl.set({
                                     multiple:'multiple'
                                 });
                             }
                         }
                     },
                     gridDocumentos
                     ],
                     buttons: [{
                         text: 'Subir documento',
                         handler: function() {
                             var form = this.up('form').getForm();
                             if(form.isValid()){
                                 form.submit({
                                     url: 'data/php/Tmc_SubirDocumento.php',
                                     waitMsg: 'Subiendo documento...',
                                     success: function(fp, o) {
                                      ventanaSubirDocumento.close();
                                         Ext.Msg.show({ 
                                             title: 'Subida de documento', 
                                             msg: 'Documento subido',
                                             icon: Ext.MessageBox.INFO, 
                                             buttons: Ext.Msg.OK 
                                         });
                                     }
                               }
                          }
                      }]
          ]
      }).show();
  </code></pre>
  
  <p>In the controller all works perfect,If I select 1,2,3,etc... files to upload the grid fills with its names.</p>
  
  <p>The problem comes when I submit the form and executing a PHP to work with the selected files,in the php if I print the $_FILES variable I only get the last selected.</p>
  
  <p>In my php in the <strong>request payload</strong> I see the three files,but $_FILES only has the last one:</p>
  
  <p>------WebKitFormBoundaryJhIv2MXqKkzPnNys
  Content-Disposition: form-data; name="filefield-1459-inputEl"; filename="file1.doc"
  Content-Type: application/msword</p>
  
  <p>------WebKitFormBoundaryJhIv2MXqKkzPnNys
  Content-Disposition: form-data; name="filefield-1459-inputEl"; filename="file2.docx"
  Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document</p>
  
  <p>------WebKitFormBoundaryJhIv2MXqKkzPnNys
  Content-Disposition: form-data; name="filefield-1459-inputEl"; filename="file3.docx"
  Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document</p>
  
  <p>Am I missing something?How can I retrieve all files after formsubmit in the php file?</p>