How can I insert images as append
into a FormData ?
I'm trying this way, but when I use console.log
to check the dados
variable, imagens
is empty.
var dados = new FormData();
$('.copiar-elemento').each(function() {
$(this).find('input:file').each(function(index, element) {
dados.append('cores[imagens][]', element.files[0]);
});
});