javascript - Dropzone.js - Setting Basic Parameters -


i trying implement dropzone.js custom cms. have no problems processing files needed in php, that's easy part.

i need know how following on page-by-page basis (will use dropzone script in several pages different functions):

  1. restrict files types (jpg,jpeg,pdf)
  2. restrict number of files can uploaded (some pages 1 file, 100)
  3. restrict max file size
  4. redirect page or have 'next' button/link appear when file upload complete.

can add @ bottom of page, while addressing settings:

<script src="../assets/global/plugins/dropzone/dropzone.js"></script> <script> jquery(document).ready(function() {    // initiate layout , plugins    metronic.init(); // init metronic core components    layout.init(); // init current layout    demo.init(); // init demo features    formdropzone.init(); }); </script> 

html:

<div id="my-dropzone"></div> 

javascript:

var initdropzone = function( filesallowed ){      dropzone.options.mydropzone = {        paramname: "file",        uploadmultiple: true,       maxfiles: filesallowed, //this need set upon init,       acceptedfiles: ['image/jpeg', 'image/jpg', 'application/pdf'],       complete: function() {           alert('your file uploaded!');       }      }; }  //init dropzone initdropzone( 4 ); 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -