Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File picker - multiple files. #183

Open
username1565 opened this issue Jan 22, 2019 · 2 comments
Open

File picker - multiple files. #183

username1565 opened this issue Jan 22, 2019 · 2 comments

Comments

@username1565
Copy link

username1565 commented Jan 22, 2019

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
Copy link
Author

username1565 commented Jan 22, 2019

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
Copy link
Author

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 username1565 reopened this Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant