Currently, I have a form where users can input their name and upload an image (logo). The client side language being used is AngularJS with dropzonejs as the image upload library. When the user clicks on the 'Edit' button, I want them to see a preview of the image they uploaded previously. To achieve this, I referred to a solution posted on this thread. However, I encountered a problem where if I upload a new image after preloading the initial image, the preview of the new image does not show up. Below is the code snippet for preloading the initial image (an angular directive is used for this purpose):
if(scope.initialFileAddress != null && scope.initialFileAddress != "") {
mockFile = {name: scope.initialFileName, size: 1000, type: "image/jpeg"}
this.addFile.call(this, mockFile)
this.options.thumbnail.call(this, mockFile, scope.initialFileAddress)
}