In my app I need to upload an image to the server, and user needs to preview the file before uploading it. So do it like this:
Show an image preview before upload
But after posted to server and there may be some errors, I have to return it back to client. Of course, the preview image loaded on client was lost, now I want to load it back again but I can't find the file to load using javascript. I have tried some ways:
$("file-input-selector").prop("files")
or:
document.getElementById("file-input-id").files
These only work when I select another image on the machine. After posted back from server both ways show 0 files
Is there another way to get the file after posted to the server back?