Im using dropzonejs to upload photos to my website. The problem is, when I click dropzone to upload, it won't show 'Gallery' as an option as seen in this image :
How to add Gallery as an option?
As a matter of fact, in order to show the gallery app to android user, your <input>
element must have two properties explicitly defined:
type which is file
and accept which could be, as mentioned, image/*
(or any image-related mime-type)
A way to achieve this is by instantiating the Dropzone object yourself rather than relying on the dropzone class of a <form>
:
// removes the magical auto discovery of dropzone forms
Dropzone.autoDiscover=false;
// add accepted mimeTypes options (comma separated string)
// myDz is the camelCased version of the id of the element that will be "dropzoned"
Dropzone.options.myDz = { acceptedFiles: 'image/*'};
$(function(){
// instantiate dropzone on element with #my-dz id
// if no action in the form or applying dropzone on a non form (ie a div),
// you should at least pass the url in an object as the second parameter
dz = new Dropzone('#my-dz' /*, {url:"/my-upload-url"}*/);
});
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/dropzone.js"></script>
<link target='_blank' href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/dropzone.css" rel="stylesheet"/>
</head>
<body>
<div class="ctn">
<h1>Test Dropzone Android</h1>
<form action="#" method="post" class="dropzone" id="my-dz"></form>
</div>
</body>
</html>
I've had the same issue with plupload and I fixed with:
document.querySelectorAll('input[type=file]')[0].setAttribute("accept","image/*");
I am trying to implement a chat application using the codeigniter framework but on form submit, the form data does not get submitted and the submit button becomes disabled. when I check on the ...
I am trying to implement a chat application using the codeigniter framework but on form submit, the form data does not get submitted and the submit button becomes disabled. when I check on the ...
Sincere apologies if this has already been covered. I've been trawling StackOverflow for a while now and I cannot find anything that will fix my issue. Many people have this error, but theirs seem to ...
Sincere apologies if this has already been covered. I've been trawling StackOverflow for a while now and I cannot find anything that will fix my issue. Many people have this error, but theirs seem to ...
I need to draw a line in the following manner: For now, it will be only drawn in code, no user input. My question is, how to draw perpendiculars to a line, if I draw it point by point? (Obviously,...
I need to draw a line in the following manner: For now, it will be only drawn in code, no user input. My question is, how to draw perpendiculars to a line, if I draw it point by point? (Obviously,...
Code: $("input[type=checkbox]").on("click", function() { deptsSelected = '<div id = "selected"> ' + $("label[for='" + this.id + "']").text() + '</div>'; $("#tabs").append(...
Code: $("input[type=checkbox]").on("click", function() { deptsSelected = '<div id = "selected"> ' + $("label[for='" + this.id + "']").text() + '</div>'; $("#tabs").append(...