我已经集成了下拉列表,它可以很好地处理上传的文件等等。我想做的是在上传成功后隐藏进度条,并将文件名替换为指向实际上传文件的链接。当每个文件上传完毕时,这会自动发生.
看一下文档,我知道我应该用
this.on("success", function(file, response) {
if (response.success == 'true') {
// hide progress bar '.dz-progress'
// replace .data-dz-name with url from response
}
});但是,我还没有弄清楚如何访问特定的html元素来替换/隐藏等。
编辑:I能够使用原始dropzone.css中的css类隐藏/转换进度条。现在只需要找到一种用'a‘标记替换文件名的方法。
发布于 2017-12-23 14:48:27
适用于Dropzone 5.x及以上
更新缩略图的正确方法是修改成功回调中的预览模板,如下所示:
this.on("success", function(file, response) {
// modify the preview template
file.previewTemplate.appendChild(document.createTextNode(response.filePath));
});用于Dropzone的参考教程以及服务器端处理
发布于 2017-03-14 19:14:23
$('.dz-progress').hide();或
$(".dz-progress").remove();并取代.data-dz-name
$('.data-dz-name').html(url from response);https://stackoverflow.com/questions/42794594
复制相似问题