Dear all,
I am trying to post data information from form to server, from last time post only data is work but now I would like to post file also.
Could you please kindly help me to make it work?
“`//check file choose waitPOattach
var files = document.getElementById(“waitPOattach”).files;
var file = files[0];
$.ajax({
url: “action.php”,
method: “POST”,
data: { function : ‘updateprojectstatus_ID’,
samplingdate : document.getElementById(‘SamplingDate’).value,
collectsample : collectsample,
waitPOattach : file,
collectsamplecomment : document.getElementById(‘collectsamplecomment’).value,
remark : document.getElementById(‘remark2’).value
},