0
私のdropzoneは正常に動作しますが、オプションを選択しません。Dropzone js - オプションを選択しない
init関数は呼び出されません。
<div class="row">
<form method="post" id="uploadFiles" style="width:200px; height:100px; border:1px solid red;">
{{ csrf_field() }}
</form>
</div>
<script>
$(function() {
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("#uploadFiles", { url: "{{Request::url()}}", method:"post"});
console.log(myDropzone);
Dropzone.options.uploadfiles = {
paramName: "file", // The name that will be used to transfer the file
maxFilesize: 2, // MB
init: function() {
alert('init called');
},
accept: function(file, done) {
if (file.name == "justinbieber.jpg") {
done("Naha, you don't.");
}
else { alert('not accepted') }
},
};