We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1778
    • 659 Posts
    Hello
    I would like to have a multiple files upload field in a 3PC CMP I'm working on.. I know
    xtype: 'textfield',
    inputType: 'file',
    name: 'file',
    width: 300,
    fieldLabel: 'Select a file to upload ',
    anchor: '100%'
    


    This works fine but allows to select only one file.... Is there a way (another inputType, or xtype or...) to allow a multi selection ?

    I looked at Gallery code, I've seen it uses somewhere an utility called 'fileuploader.js' but I have no idea on how I can use it in my case (how I refer to these utility in my CMP how to use it ?)

    Thanks in advance
    Cheers
      • 8386 ☆ A M B ☆
      • 160 Posts
      From what I can tell there is no way of doing this in the standard ExtJS setup, what you see in gallery is an utility created by Shaun to use http://blueimp.github.com/jQuery-File-Upload/ as his uploader.
        • 4172
        • 5,888 Posts
        would be nice to have a TV-input type with this jqery-file-Uploader. Then we can use this for resources and custom-db-tables in xdbedit or MIGXdb.

        anyone?
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 1778
          • 659 Posts
          I've found a solution with no JQuery, only EXtJS... It seems to work I have to test deeper but for those who are interested :
          xtype: 'textfield',
          inputType: 'file',
          name: 'files[]',            
          fieldLabel: 'select files to upload ',
          autoCreate: { tag: 'input', type: 'text', size: '70', autocomplete: 'off', multiple: 'multiple' },
          


          The trick is in the autoCreate that allow to add the "multiple: 'multiple' " piece of tag, and not forgot to name the field as a table (files[])... This way allows to multi select files using the traditional way.... (easy for end-users)... Of course you have to adapt your php code to deal with the array of arrays (files[]) but it's out of the scope for this thread ^_^
          Cheers
            • 8386 ☆ A M B ☆
            • 160 Posts
            Nice find anso, this will help others also.