I'm doing a project in which I want to upload images to a server, but before sending it to the server, a preview of the image is shown, for that I use the following code. It is worth mentioning that the user can choose several images and several times they are added to a div as a preview.
$(document).on('change', 'input:file', function (e) {
//document.getElementById('listimangen').addEventListener("DOMSubtreeModified", Reaubicar, false);
for (var i = 0; i < e.target.files.length; i++) {
var image_object_url = URL.createObjectURL($(this).get(0).files[i]);
$('#container').append($('<div class="thumbnail"/>').load("/Proyectos/ImagenBrief?url=" + image_object_url, function () {}));
}
});
Inside the event Change
generated the URL of type BLOB to show the preview without uploading image to the server.
My problem is how you sent the src preview to save to the server if it is a blob url