Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

88
Views
HTML Form not submitting any attached file

my form does not take or submit any attachment file and has the enctype and method attributes inside the form element. It looks like this:

<form action="vsend.php" class="volunteerAppForm" method="post" onsubmit="return validateForm()" role="form" enctype="multipart/form-data">

<div class="fileUploadSection">
    <label for="fileToUpload">Please upload your CV</label><br>
    <input type="file" name="file" id="fileToUpload" required>
  </div>
  <div class="captcha">
    <div class="g-recaptcha" data-sitekey="6Ld071QUAAAAAIutKo0CkibGU8oeaomD5niSfNiX"></div>
    <input type="submit" name='submit' value="send" class="submit-input" style="cursor: pointer;">
  </div>
</form>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I debugged my codes, the problem was in my strings just in my php file here:

//Attachments
    if (
        isset($_FILES['uploaded_file']) &&
        $_FILES['uploaded_file']['error'] == UPLOAD_ERR_OK
    ) {
        $mail->AddAttachment(
            $_FILES['uploaded_file']['tmp_name'],
            $_FILES['uploaded_file']['name']
        );
    }

As my input type attribute has a value "file", my string should also have the same name 'file' not 'uploaded_file' as showen above. Could be like so:

//Attachments

    if (
        isset($_FILES['file']) &&
        $_FILES['file']['error'] == UPLOAD_ERR_OK
    ) {
        $mail->AddAttachment(
            $_FILES['file']['tmp_name'],
            $_FILES['file']['name']
        );
    }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!