Hello I have this problem, I want to pass my picture and save it on database through AJAX but, it isn´t working, I have to different combination in javascript
function nahraj(){
var text = $('#subor').val();
$.post( "aktualizuj.php", {
'subor':text
}, function (data) {
$('#result').html(data);
}
);
}
this one works but after I send it I am getting a road to my picture as : C:/fakepath/picture.jpg So I thougt that I should set an enctype there so I search a way how to do it, I found something and I make something like this :
function nahraj(){
var text = $('#subor').val();
$.post.enctype("multipart/form-data").( "aktualizuj.php", {
'subor':text
}, function (data) {
$('#result').html(data);
}
);
}
but this version doesn´t do anything so it does not work, what am I doing wrong ?