I am uploading a file using AJAX and jQuery. It is working well in Chrome and Firefox but the problem I am getting is in Safari. I tried to debug this but the debugger did not stop when I upload the file.
<input type="file" class="file_input" name="myfile"/>
$(document).on('input', '.file_input', function() {
var that = $(this);
var formData = new FormData();
formData.append("userfile", this.files[0]);
showLoader();
$.ajax({
cache: false,
headers: {
'X-CSRF-Token': _token
},
url: base_url + "controller/action",
type: 'POST',
data: formData,
contentType: false,
processData: false,
success: function(data) {
that.closest('tr').find('.document').empty();
hideLoader();
}
});
});