Input type file multiple not work

I use input html form like this:

        <input
                id="myAttachment"
                type="file"
                name="file"
                ng-model="attachFiles"
                onchange="angular.element(this).scope().onFileSystemChange(this)"
                multiple
                accept="image/*,video/*">

everything works fine except the multiple attribute. I couldnt find a way to be able to select multiple file, it keep making me select single file.
Does anyone have solution for this ?
Thank you very much.

1 Like

Hi,

Keep in mind that <input multiple> is for html5 only. It will just fall back to single file on older browsers.
You could try and specify the name as an array: name[]="file". It is not needed by spec but it can help…
Try as well to do a readout on the console of the “file[]” variable.

Happy hacking

Thank you for your information.
I change to name[]="file" but it still doesn’t allow me to pick multiple file on my device (Android). Maybe I dont fully understand what you mean…
If it s about old browsers problem, could installing Crosswalk resolve the issue ?

yes

(filling up my 20caracters)

it seems not working for me :frowning: . after I install Crosswalk, the input now include camera picker and something else but I still can’t pick multiple file.

Sorry, I had a typo in the previous answer… change it to
name="file[]"

This works for me:

`

Submit

`

Hi, i have the same issue, i use an iput file like this.

<input id="multipleLocalFilesSelector" type='file' name='files[]' nv-file-select uploader="uploader" multiple="multiple" accept="image/jpeg,image/png" style="visibility:hidden">

web view and iphone work fne with multiple selection, but on android i can’t do that.

I have the same issue with android.

<input ng-click="upload()" id="file" type="file" file-model="data.myFile" multiple style="display: none;"> 

Has someone solved?

Hi, I’m searching a way to solve this problem, but caniuse says: this feature is not supported by android browsers http://caniuse.com/#feat=input-file-multiple

Using Crosswalk are you able to choose multiple files?

for Camera attachment option you can use this to upload multiple snaps with this code

  var options = {
                 maximumImagesCount: 5,
                 width: 100,
                 height: 100,
		};
             window.imagePicker.getPictures(
	            function (results) {
	                for (var i = 0; i < results.length; i++) {
	                    console.log('Image URI: ' + results[i]);
	                }
	            }, function (error) {
	                console.log('Error: ' + error);
	            }, {
	                maximumImagesCount: 10,
	                width: 800
	            }
    );