[英]dropzone.js autoprocessqueue:false don't work
I try to use a button to submit my download. 我尝试使用按钮提交下载。 I am following the introduction of this guide .
我正在关注本指南的介绍。
This is my path: 这是我的路:
<form action="index.php/controller/upload" class="dropzone" id="my-dropzone"></form>
and this is my upload function: 这是我的上传功能:
public function upload() {
if (!empty($_FILES)) {
$tempFile = $_FILES['file']['tmp_name'];
$fileName = 'test.csv';
$targetPath = getcwd() . '/application/models/uploads/';
$targetFile = $targetPath . $fileName;
move_uploaded_file($tempFile, $targetFile);
}
}
just standard stuff but what am I missing? 只是标准的东西,但是我想念什么呢? Because it is still uploading instantly.
因为它仍在即时上传。
you can edit my dropzone function to your needs 您可以根据需要编辑我的dropzone功能
var QuoteDropzone = new Dropzone('#quote_upload', {
init: function () {
var dropzone = this;
$("#removeAllFiles").click(function () {
dropzone.removeAllFiles();
});
$('#quote_upload_submit').click(function () {
QuoteDropzone.processQueue();
});
},
parallelUploads: 20,
url: "/quotes/quote-upload",
autoProcessQueue: false,
type: 'POST',
success: function () {
toastr.success('<h3>Success</h3><p>Files Uploaded</p>');
},
error: function() {
toastr.error('<h3>Error</h3><p>Files Not Uploaded</p>');
}
});
will help you more tonight if you still have a problem 如果您仍有问题,将在今晚为您提供更多帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.