When I make false contentType,processData all of data come null. How can I solve this problem ? if I dont write these ones. the datas come without photo. That says illagal method.
var photo = document.getElementById("Resim");
var file = photo.files[0];
var formData = new FormData();
formData.append("file-0", file);
$.ajax({
url: "/Makale/MakaleDuzenle/" + al,
type: "POST",
data: { KategoriID: kategoriID, icerik: icerik, Baslik: baslik, etiketler: etiket, Resim: formData },
dataType: "json",
encode: true,
cache: false,
contentType: false,
processData: false,
error: function (result) { alert("hata") },
success: function (result) {
alert(formData);
console.log(result);
var tag ="* "+'<tr> <td style="color:#ed9d68";font-size:20px;">' + result.message + '</td></tr>';
$(".errorMessages").append(tag);
}
});