JavaScript How to upload photo from gallery in Android to a website with Dropzonejs? upload photo from iphone,upload photo from iphone to pc,

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 :

enter image description here

How to add Gallery as an option?

Answer:1

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>
Answer:2

I've had the same issue with plupload and I fixed with:

document.querySelectorAll('input[type=file]')[0].setAttribute("accept","image/*");
Answer:3

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 ...

  1. codeigniter chat application github
  2. codeigniter chat application source code
  3. codeigniter chat application
  4. codeigniter chat application example
  5. codeigniter chat app
  6. php codeigniter chat application
  7. codeigniter realtime chat application with jquery and ajax

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 ...

  1. uncaught referenceerror functionname is not defined

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,...

  1. drawing line with bearing and distance autocad
  2. drawing line with angle autocad
  3. drawing line with coordinates in autocad
  4. drawing line with arrow
  5. drawing with line
  6. line drawing with color
  7. lined paper drawing
  8. line drawing with shading
  9. line drawing with photoshop
  10. line drawing with pen
  11. line drawing with gimp
  12. line drawing with illustrator
  13. drawing with line of action
  14. line drawing with dda
  15. line drawing with mouse
  16. line drawing with hand
  17. drawing with line tool
  18. drawing a line with css
  19. drawing a line with a chicken
  20. drawing a line with a compass

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(...