I checked the code (from starTutorial) and it didn't work for me either(?)
I managed to get it working by replacing this:
$.get('upload.php', function(data) {
$.each(data, function(key,value) {
var mockFile = { name: value.name, size: value.size };
thisDropzone.options.addedfile.call(thisDropzone, mockFile);
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, "uploads/"+value.name);
});
});
with this:
$.getJSON('files/list-all', function(data) {
$.each(data, function(index, val) {
var mockFile = { name: val.name, size: val.size };
thisDropzone.options.addedfile.call(thisDropzone, mockFile);
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, "uploads/" + val.name);
});
});
Credit to this answer: https://stackoverflow.com/a/5531883/984975
EDIT:
In version 4.0 the thumbnails of the existing files will be showed with the cue bar in it. To solve this add:
thisDropzone.emit("complete", mockFile);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…