I want to send input file and some strings via ajax, but I can't send the file because it doesn't have to be processed ( so i should use processData: false) but if I use it every string I pass result as not indexed
JS script:
var Name = document.getElementById("Name").value;
    var Surname = document.getElementById("Surname").value;
    var Residence = document.getElementById("Residence").value;
    var Email = document.getElementById("Email").value;
    var Phone = document.getElementById("Phone").value;
    var JCurriculum = document.getElementById("Curriculum").files[0];
    var Curriculum = new FormData();
    Curriculum.append("Curriculum", JCurriculum);
    $.ajax({
        method: 'POST',
        url: "scripts/register.php",
        data: {
            Name: Name,
            Surname: Surname,
            Residence: Residence,
            Email: Email,
            Phone: Phone,
            Curriculum: Curriculum
        },            
        success: function (Curriculum) {
            alert('Success');
        }
    });
PHP script:
$Name = $_POST['Name'];
$Email = $_POST['Email'];
$Surname = $_POST['Surname'];
$Residence = $_POST['Residence'];
$Phone = $_POST['Phone'];
$Curriculum = $_POST['Curriculum'];
$Name = filter_var($Name, FILTER_SANITIZE_STRING);
$Surname = filter_var($Surname, FILTER_SANITIZE_STRING);
$Email = filter_var($Email, FILTER_SANITIZE_EMAIL);
$Residence = filter_var($Residence, FILTER_SANITIZE_STRING);;
$Phone = filter_var($Phone, FILTER_SANITIZE_STRING);;
If I put processData:false in the before success: I have this error Undefined index
 
    
Contact from Website
- Nome: {$Name}
- Cognome: {$Surname}
- Comune di residenza: {$Residence}
- Email: {$Email}
- Telefono: {$Phone}
- Curriculum: {$Curriculum}
"; There is more code but i show the most important, i can see all the strings like email , name ecc... but I don't receive the curriculum attached – Jul 11 '18 at 06:47