Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6093057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:30:59+00:00 2026-05-23T12:30:59+00:00

after pulling my hair out for two days trying to figure this issue out

  • 0

after pulling my hair out for two days trying to figure this issue out I finally decided to join this community as a last resort in search of some serious aid.

Basically I have a form that is supposed to send an email along side an attachment (like a resume / C.V) that a user as uploaded. I am using Jquery to validate on clientside and Ajax / Json to send the form to my PHP mailer file and get a response back etc without refreshing.

The email portion of everything works perfectly but somehow the attachment is not reaching me.
This is my Jquery code below, Im praying someone out there will know where this noob is messing up…

    $('#jobsubmit').click(function(e){

                e.preventDefault();  



                  var valid = '';
                  var required = 'is required';
                  var fileUpload = $('form#jobform #cv_upload').val().split('.').pop().toLowerCase();
                  var allow = new Array('jpg','wps','odf','txt','rtf','doc','docx','pdf');
                  var jobtitle = $('form#jobform #job_title').val();
                  var name = $('form#jobform #job_name').val();
                  var email = $('form#jobform #job_email').val();
                  var contactnumber = $('form#jobform #job_number').val();
                  var portfolio = $('form#jobform #job_portfolio').val();

                  var honeypot = $('form#jobform #honeypot').val();
                  var humancheck = $('form#jobform #humancheck').val();





                  if(name = '' || name.length <= 2) {
                      valid = '<p class= \"errortext_jobs\">Your name ' + required + '</p>';
                      }


                  if(jQuery.inArray(fileUpload, allow) == -1) {
                      valid += '<p class= \"errortext_jobs\">Please select a valid C.V file type to upload.</p>';

                      }


                  if(!email.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
                      valid += '<p class=\"errortext_jobs\">Your email ' + required + '</p>';
                  }

                  if(!contactnumber.match(/^([0-9]+)$/)) {
                      valid += '<p class=\"errortext_jobs\">Your number ' + required + '</p>';
                  }







                  if(honeypot != 'http://') {
                      valid += '<p class=\"errortext_jobs\">Spambots are not allowed</p>';

                  }

                      if(humancheck != '') {
                      valid += '<p class= \"errortext_jobs\">A Human user ' + required + '</p>';

                  }


                  if (valid != '') {
                        $('#job_response').removeClass()
                        .addClass('error')
                        .html('<p class= \"errortitle\"> Please correct the errors below </p>' + 
                        valid)
                       .fadeIn('fast');

                  }   else {
                        $('#job_response').removeClass()
                        .addClass('form_processing')
                        .html('<p class= \"processtitle\">Processing...</p>')
                        .fadeIn('fast'); 




                  var formData = $('form#jobform').serialize();
                  submitForm(formData);

                  }


                });

});


function submitForm(formData) {

$.ajax({

       type:'POST',
       url:'jobengine.php5',
       data: formData,
       dataType: 'json',

       timeout: 7000,
       success: function(data) {


                    $('#job_response').removeClass()
                        .addClass((data.error === true) ? 'error' : 'success')
                        .html(data.msg).fadeIn('fast');

if ($('#job_response').hasClass('success')) {

setTimeout("$('#job_response').fadeOut('slow')", 5000);                              
}

     },
        error: function(XMLHttpRequest, textStatus, errorThrown){

                $('#job_response')
                .removeClass().addClass('error')
                .html('<p class= \"errortext_jobs\">There was an ' + errorThrown + '</p>'
                      + '<p class= \"errortext_jobs\"> error due to an ' 
                      + textStatus +  '</p>'
                      + '<p class= \"errortext_jobs\"> condition. </p>').fadeIn('fast');



        },
        complete: function(XMLHttpRequest, status){
            $('form#jobform')[0].reset();

        }






});

And this is the HTML portion below:

  <form id="jobform" method="post" action="jobengine.php5" enctype="multipart/form-data">





    <p class="formtext_job" >Job Position:</p> 
    <input type="text"   name="job_title" id="job_title"/>



    <p class="formtext_job" >Your Name:<span class="red">*</span> </p>
    <input type="text"   name="job_name" id="job_name"/>



    <p class="formtext_job" >Your Email:<span class="red">*</span></p>
    <input type="text"   name="job_email" id="job_email"/>



    <p class="formtext_job" >Your Contact Number:<span class="red">*</span></p>
    <input type="text"   name="job_number" id="job_number"/>


    <p class="formtext_job" >Your Website:</p><span class="italicgrey">(If applicable) </span>
    <input type="text"   name="job_portfolio" id="job_portfolio"/>





<div class="input_pos"> 
<p class="formtext_job2" >Attach your C.V :</p>

    <div class="uploadimg">
    <input type="file" id="cv_upload" name="cv_upload"  />
    </div>
    <div id="upload_list"></div>
 </div>  







 <input type="image" name="jobsubmit" value="submit" 
 src= "../images/buttons/form_buttons/apply_button.jpg" id="jobsubmit" />




<input type="hidden" name="honeypot" id="honeypot" value="http://" />

<input type="hidden" name="humancheck" id="humancheck" class="clear" value="" />

</form> 

If more info is required please let me know as I have be fighting this thing for so long…

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:31:00+00:00Added an answer on May 23, 2026 at 12:31 pm

    $.ajax doesn’t support file uploads, plain and simple.

    This is because you can’t do file uploads with XHR, because JavaScript can’t read the file data.

    You need to submit the form to a hidden iframe or make use of Flash/Java/etc for file uploads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So after pulling my hair out for an hour, I decided to post this
So after pulling my hair out for 30 minutes, I have decided to come
Hi Ive been pulling my hair out over this for the last couple of
After pulling all my hair out it has come down to this minimal html
After many hair-pulling frustrations I've finally got one version of the PerlMagick module working
I've been pulling my hair out trying to get some data to come across
I am pulling my hair out with this one. I have a table inside
I have been pulling my hair out trying to get the shadows to work
Im ready to start pulling my hair out here. Trying to use jquery ajax
I'm pulling my hair out on this one. I have a site which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.