Input type file multiple not work

#1

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
#2

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

#3

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 ?

#4

yes

(filling up my 20caracters)

#5

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.

#6

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

This works for me:

`

Submit

`
#7

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.

#8

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?

#9

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

#10

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
	            }
    );