moxie icon indicating copy to clipboard operation
moxie copied to clipboard

File picker - multiple files.

Open username1565 opened this issue 6 years ago • 2 comments

Is this possible to select multiple files, here: https://github.com/moxiecode/moxie/wiki/File-Picker

<input type="file" multiple="true"> I see hidden input-element in HTML of this code, without multiple-attribute, when I running this code: https://github.com/moxiecode/moxie/wiki/File-Picker I did try this:

accept: [
	{title: "Images", extensions: "jpg,gif,png", multiple: "true"} // accept only images
]

But not working... I see, this is available, in moxie.js, here:

Line 7176: shimContainer.innerHTML = '<input id="' + I.uid +'" type="file" style="font-size:999px;opacity:0;"' +
Line 7177: (_options.multiple && I.can('select_multiple') ? 'multiple' : '') +

But I don't know how to activate this...

If this is possible to working with multiple files, can you add the info, as example here: https://github.com/moxiecode/moxie/wiki/File-Picker ???

I did go to moxie, from here: https://stackoverflow.com/questions/30727052/file-constructor-in-ie-and-safari by searching polifyll-function for new File()-object, because I cann't call new File(). I see the an error in console.log of my browser: Uncaught TypeError: Failed to construct 'File': Illegal constructor

I general, I just want to add text inpututed dataURL to input[type=file] as element for upload.

Is there the better solution for input[type=file multiple="true"]? For example, dataURL or base64 is pasted in textarea, then, file added with random name to file-input, and then this MULTIPLE files available for uploading.

username1565 avatar Jan 22 '19 11:01 username1565

To using multiple file input, just need to specify multiple:true

var fileInput = new moxie.file.FileInput({
	browse_button: 'file-picker', // or document.getElementById('file-picker')
	accept: [
		{title: "Images", extensions: "jpg,gif,png"} // accept only images
	],
	multiple: true	//here this specified
});

Please add full explanation about this, to your example page.

This issue is closed.

But new File() still not working for me... Maybe, need to call this, something, like new moxie.File()??

username1565 avatar Jan 22 '19 12:01 username1565

I leave this Issue opened until you not add multiple:true in your example. You can close this issue yourself.

Have a nice day.

username1565 avatar Jan 23 '19 05:01 username1565