<input type="file" onchange="setPhoto(this)" />
function setPhoto(elem) {
var fd = new FormData;
fd.append('file', $(elem).prop('files')[0]);
$.ajax({
url: "урл на пхп обработчик",
data: fd,
processData: false,
contentType: false,
type: 'POST',
success: function (a) {
$('.container-photo img').attr('src', a.data.photo);
}
});
}