Экспортировал сайт на тильде на свой сервер. Нужно переделать форму api на самописную.
Использую обыкновенный ajax + php обработка на сервере, все данные получаю, но переменная $_FILES пустая (ничего нет)
В чем может быть траблы?
Сама форма:
<form id="form371121162" name="form371121162" role="form" action="" method="POST" data-formactiontype="0" data-inputbox=".t-input-group" class="t-form js-form-proccess t-form_inputs-total_5 t-form_bbonly " data-success-callback="t702_onSuccess">
<!-- NO ONE SERVICES CONNECTED --> <input type="hidden" name="tildaspec-formname" tabindex="-1" value="Рассчитать стоимость">
<div class="js-successbox t-form__successbox t-text t-text_md" style="display:none;color:#ffffff;background-color:#1953ff;">В ближайшее время мы свяжемся с вами!</div>
<div class="t-form__inputsbox">
<div class="t-input-group t-input-group_nm" data-input-lid="1590609651330">
<div class="t-input-block" style="position: relative; overflow: hidden;">
<input type="text" autocomplete="name" name="name" class="t-input js-tilda-rule t-input_bbonly t-input_pvis" value="" placeholder="" data-tilda-rule="name" style="color:#002e6d; border:1px solid #002e6d; ">
<div class="t-input__vis-ph">Имя</div>
<div class="t-input-error"></div>
</div>
</div>
<div class="t-input-group t-input-group_ph" data-input-lid="1624622207148">
<div class="t-input-block" style="position: relative; overflow: hidden;">
<input type="tel" autocomplete="tel" name="phone" class="t-input js-tilda-rule js-tilda-mask t-input_bbonly t-input_pvis" value="" placeholder="" data-tilda-rule="phone" pattern="[0-9]*" data-tilda-mask="+7 (999) 999-9999" style="color:#002e6d; border:1px solid #002e6d; ">
<div class="t-input__vis-ph">Телефон</div>
<div class="t-input-error"></div>
</div>
</div>
<div class="t-input-group t-input-group_em" data-input-lid="1624622235766">
<div class="t-input-block" style="position: relative; overflow: hidden;">
<input type="text" autocomplete="email" name="email" class="t-input js-tilda-rule t-input_bbonly t-input_pvis" value="" placeholder="" data-tilda-req="1" data-tilda-rule="email" style="color:#002e6d; border:1px solid #002e6d; ">
<div class="t-input__vis-ph">Email*</div>
<div class="t-input-error"></div>
</div>
</div>
<div class="t-input-group t-input-group_ta" data-input-lid="1592901363227">
<div class="t-input-block" style="position: relative; overflow: hidden;">
<textarea name="query" class="t-input js-tilda-rule t-input_bbonly t-input_pvis" placeholder="" style="color:#002e6d; border:1px solid #002e6d; height:102px" rows="3"></textarea>
<div class="t-input__vis-ph">Описание запроса</div>
<div class="t-input-error"></div>
</div>
</div>
<div class="t-input-group t-input-group_uw" data-input-lid="1591796925148">
<div class="t-input-subtitle t-descr t-descr_xxs t-opacity_70" data-redactor-toolbar="no" field="li_subtitle__1591796925148" style="color:#002e6d;">Добавить файлы (если есть):</div>
<div class="t-input-block">
<div class="t-upwidget" style="margin-bottom:10px;">
<div class="t-upwidget-container" data-tilda-name="file" data-tilda-upwidget-key="yandex-199d803733c5b702533a7cc" id="21727169220445242" data-tilda-upwidget-multiple="true" data-tilda-accept="text/*,application/vnd.ms-excel,application/vnd.ms-powerpoint,application/msword,application/vnd.oasis.opendocument.*,application/pdf,application/rtf,application/vnd.visio,image/*,video/*,audio/*,application/x-rar-compressed,application/x-tar,application/zip,application/x-7z-compressed,application/x-bzip,application/x-bzip2" data-tilda-upwidget-file-size="31457280">
<div style="color:#ffffff;background-color:#ff0000;border-radius:30px;font-family:GrtskPeta, Arial, sans-serif;font-size:16px;" class="t-upwidget-container__button t-text">Загрузить файлы</div>
<div class="t-upwidget-container__data">
<div class="t-upwidget-container__button-indiv t-text">Добавить файлы</div>
</div>
</div>
<script src="js/tilda-upwidget-1.1.min.js" async=""></script> <!-- script src='https://upwidget.tildacdn.com/js/tilda-upwidget-1.1.min.js' async></script -->
</div>
<div class="t-input-error"></div>
</div>
</div>
<div class="t-form__errorbox-middle">
<div class="js-errorbox-all t-form__errorbox-wrapper" style="display:none;">
<div class="t-form__errorbox-text t-text t-text_md">
<p class="t-form__errorbox-item js-rule-error js-rule-error-all"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-req"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-email"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-name"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-phone"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-minlength"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-string"></p>
</div>
</div>
</div>
<div class="t-form__submit">
<button class="t-submit" style="color:#ffffff;background-color:#ff0000;border-radius:30px; -moz-border-radius:30px; -webkit-border-radius:30px;font-weight:400;" data-btneffects-first="btneffects-flash" id="submit-btn">
Отправить
<div class="t-btn_wrap-effects">
<div class="t-btn_effects"></div>
</div>
</button>
</div>
</div>
<div class="t-form__errorbox-bottom">
<div class="js-errorbox-all t-form__errorbox-wrapper" style="display:none;">
<div class="t-form__errorbox-text t-text t-text_md">
<p class="t-form__errorbox-item js-rule-error js-rule-error-all"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-req"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-email"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-name"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-phone"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-minlength"></p>
<p class="t-form__errorbox-item js-rule-error js-rule-error-string"></p>
</div>
</div>
</div>
<div style="position: absolute; left: -5000px; bottom:0;"><input type="text" name="form-spec-comments" value="Its good" class="js-form-spec-comments" tabindex="-1"></div>
</form>
Ajax:
$( document ).ready(function() {
//удаляем тильдовскую отправку формы
$( "#form371121162 button[type='submit']" ).attr('id', 'submit-btn');
$( "#form371121162 button[type='submit']" ).removeAttr('type');
//добавляем ajax по клику на кнопку
$( "#form371121162 #submit-btn" ).click(function(e) {
console.log('123');
var msg = $( "#form371121162").serialize();
$.ajax({
dataType: 'json',
data: msg,
method: "POST",
url: '/api.php',
});
});
});