Good day! There is some form that conveys a message. She transmitted to server.php with the following code:
function sendAjaxForm(infoBox, addUser, url) { jQuery.ajax({ url: 'server.php', type: "POST", dataType: "html", data: jQuery("#"+addUser).serialize(), success: function(response) { result = jQuery.parseJSON(response); document.getElementById(infoBox).innerHTML += "<tr><td><b>"+result.name+"</b></td></tr><tr><td>"+result.msg+"</td></tr>";// ИСПРАВИТЬ }, error: function(response) { // Данные не отправлены document.getElementById(infoBox).innerHTML = "Ошибка. Данные не отправленны."; } }); } Now I wanted to attach files to the message via
<input type='file' name='msgFile'> Question: how to change the script (1) so that the file will also fly to server.php and then be downloaded via FTP?