我正在使用 Dropzone:
jQuery(function () {
let dropzone = jQuery("#upload-box")
dropzone.dropzone({
url: "/file/upload",
autoProcessQueue: false,
addedfile: function (file) {
console.log(file)
}
})
})
在添加的文件中,我不想将其添加到 input<input type="file" name="file">中。我知道如何创建输入但不知道如何添加文件,所以当我提交整个表单以$_FILES在服务器上的数组中获取它时。#upload-box是 div,而不是表单,这就是为什么我想在<input type="file" name="file">.