I have the following code which shows an image in a thumbnail using jQuery, which my idea is to pass "the image" of ajax to the controller to do what I need
$('#subirFoto').on("change", function (event) {
$("#arrastreImagen").html("");
var salida = $("#subirFoto").val();
alert($("#subirFoto")[0].files[0]);
salida = URL.createObjectURL(event.target.files[0]);
$("#arrastreImagen").append('<span><i class="fa fa-times btn btn-danger eliminarFoto"></i></span><div id="imagenBeer"><img src="' + salida + '" class="img-thumbnail"></div>')
$.ajax({
url: "guardarImagen",
method: "POST",
data: { img: salida },
async: false,
//dataType: "json",
success: function (respuesta3) {
}
});
});
I know how to capture the data in the controller but how do I receive the image (I do not know if the data I'm passing is correct), rename it and save it in the "X" project folder? Thanks