I have the following form in my code which needs to be submitted in order to send a email to the client :-
    <form  enctype="multipart/form-data" id="jobapplication">
              <div class="form-group">
              <input type="email" class="form-control" aria-describedby="email Help" placeholder="Email Id *" name="email" required> <!--Input field for email-->
              </div>
               <div class="form-group">
              <input type="text" class="form-control" aria-describedby="Name Help" placeholder="Name *" name="name" required>   <!--Input field for name-->
               </div>
                <div class="form-group">
              <input type="phone" class="form-control" aria-describedby="Phone Help" placeholder="Phone *" name="phone" required> <!--Input field for phone-->
               </div>
                <div class="form-group">
              <input type="file" class="form-control" aria-describedby="Resume Help" placeholder="Resume" name="resume" required>  <!--Input for selcting resume-->
               </div>
                 <div class="form-group">
              <input type="text" class="form-control in-position " aria-describedby="email Help"  name="position" readonly> <!--Displaying the position applied-->
                 </div>
                 <div class="form-group">
                     <div class="g-recaptcha" data-sitekey="6LcpH3YUAAAAABF4UFt9WoLsrgug0wZ3O8zK0t_9"></div>
                 </div>
               <div class="form-group text-center">
                  <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button> <!--the cancel button-->
                  <button type="sumbit" class="btn btn-primary">Apply</button>  <!--the apply button-->
                </div>
             </form>
and the following javascript code to read the formdata using FormData and ajax
$(document).ready(function(){
       $('#jobapplication').submit(function(e){
           e.preventDefault();
           var fr=$('#jobapplication')[0];
           var form=new FormData(fr);
           $.ajax({
              type:'POST',
              url:'apply',
              data:form,
              dataType:'json',
              cache: false,
            contentType: false,
            processData: false
           }
             )
          .done(function(data)
          {
                if(data.info=="success")
                    {
                        window.location.href='/end';
                    }
           })
           .fail(function(data)
             {
               alert(data.err);
           })
           .always(function(data)
            {
               $('input[name=name]').val('');
               $('input[name=email]').val('');
               $('input[name=phone]').val('');
               $('input[name=resume]').val('');   
               grecaptcha.reset();   
           });
       }); 
    });
but on running i'm getting the following error :- undefined in the alert dialog box can any body tellme how to read the file from this form and then use it to sumbit the data?
