Input multiple + capture=camera
_this.hiddenFileInput.setAttribute("multiple", "multiple");
When using in mobile browsers "multiple" attribute prevents from capturing from camera. (capture="camera" attribute). It would be nice to have an option for this!
Same problem here. On Android we can still select between Camera or Document, but on iOS we can only navigate trough the gallery. What can we do to be able to call the Camera on iOS? Is there a workaround?
I see in the source code you can now set options.maxFiles = 1. Combined with options.capture = "camera" it should work correctly. "multiple" attribute will not be set and you'll be able to use the camera.
I've managed to get the option to take a picture even on iOS7/8 devices with the maxFiles=1. Thanks.
The capture option seems to do nothing more. The problem now is that we can't upload another file after since the total file is blocked to one. I mean, we could avoid the multiple selection for a single request without problem and click a second time to upload another one. No? Is it me that missed something or is the library that doesn't support it yet?
By the way, this is a wonderful lib!
Also, the uploadMultiple seems to do nothing more. Shouldn't it be the trigger for the multiple attribute? and maxFiles the maximum number of files supported for the dropzone?
The uploadMultiple does not seem to control normal hidden input, but it controls file input in fallback form and upload queue. That is rather confusing.
I'd try to change the line 529 in the source code from
@hiddenFileInput.setAttribute "multiple", "multiple" if [email protected]? || @options.maxFiles > 1
to
@hiddenFileInput.setAttribute "multiple", "multiple" if @options.uploadMultiple? && @options.capture != "camera"
But I am not sure if it will solve all problems.
As I see in my code, I've resorted to the following:
if (Modernizr.touch) {
dz.hiddenFileInput.removeAttribute("multiple");
dz.hiddenFileInput.setAttribute("capture", "camera");
}
If I understand what you mean, by putting capture: "camera" and uploadMultiple: false. I will not need the maxFiles: 1 to get the "Take a picture" option on an iOS device. Tell me when I will be able to download the new JS and test it. I will test it for you on iOS7 and 8.
Thanks for your precious help :-)
Sorry mate, can't tell you that - I have no relation to this project :D
Poke @enyo :D