1
如果只有最少10個文件在qeue上,我該如何設置dropzone上傳?如果只有最少10個文件位於qeue上,我如何設置dropzone上傳?
我已經設置了autoProcessQueue爲false,這樣當點擊提交按鈕時就會運行一個函數來檢查已編碼的文件。如果它們小於或大於10,則上傳不會發生。
如何存檔? 請協助。
我在谷歌搜索到處都是,但我似乎無法找到答案。 。請協助!
這裏是我的代碼..
<html>
<head>
<title></title>
<script src="ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script>
<link href="css/basic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form role= "form"></form>
<button id="submit-all">Submit all files</button>
</body>
<script>
Dropzone.options.myDropzone = {
// Prevents Dropzone from uploading dropped files immediately
autoProcessQueue: false,
init: function() {
var submitButton = document.querySelector("#submit-all")
myDropzone = this; // closure
submitButton.addEventListener("click", function() {
myDropzone.processQueue(); // Tell Dropzone to process all queued files.
});
myDropzone.on("maxfilesexceeded", function(file) { this.removeFile(file); });
// You might want to show the submit button only when
// files are dropped here:
this.on("addedfile", function() {
// Show submit button here and/or inform user to click it.
});
}
};
</script>
</html>
謝謝你這麼much.Just正是我一直在尋找! –