I\'m trying to choose an image from PC/mobile and upload it to the server on one button click but for some reason I can\'t grab the value (name) of chosen image - $_FILES[
You need to populate your FormData() with your file data:
var formData = new FormData();
$.each($('pictureCapture')[0].files, function(key, value) {
formData.append(key, value);
});
Add change your contentType to multipart in your jQuery ajax call:
$.ajax({
...
data: formData,
...
contentType: 'multipart/form-data',
...