November 18, 2020 at 11:44 pm
#10035114
Keymaster
Hello,
To send $_FILES trough AJAX contact form (the case of contact-us-recaptcha-v3 form), we need change somethings in the JS code.
Please try changing these parts of code at js/views/view.contact.js:
Change this:
// Fields Data
var formData = $form.serializeArray(),
data = {};
To this:
var formData = new FormData( $form[0] ),
data = {};
Change this:
// Ajax Submit
$.ajax({
type: 'POST',
url: $form.attr('action'),
data: data
}).always(function(data, textStatus, jqXHR) {
To this:
// Ajax Submit
$.ajax({
type: 'POST',
url: $form.attr('action'),
data: formData,
cache: false,
contentType: false,
processData: false
}).always(function(data, textStatus, jqXHR) {
This way you should be able to get $_FILES data in the PHP side.
We hope this helps!
Please try that and let us know if you need further assistance.
Kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads