title: How to upload a files in WordPress custom page template?
body: <p>I have a custom page template. This template have a custom form that user can upload a file. Now, the uploaded file/s will not upload in the MySQL but in the file system/local folder (local computer).</p>
  
  <p>I already have a PHP snippet, but the code is not working I'm getting an errors.</p>
  
  <p>How to fix this?</p>
  
  <p>Snippet:</p>
  
  <pre><code>if(isset($_POST['submit'])){
      $lastName = isset($_POST['lastName']) ? $_POST['lastName'] : '';
      $resumeFile = isset($_FILE['resumeFile']['name']) ? $_FILE['resumeFile']['name']: '';
  
  $info = pathinfo($_FILES['resumeFile']['name']);
  $ext = $info['extension'];
  $file_rename= $lastName.$ext; 
  
  $target = 'C://xampp/htdocs/files/'.$file_rename;
  move_uploaded_file($_FILES['resumeFile']['tmp_name'], $target);
  }
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code>Notice: Undefined index: resumeFile .... on line 130
  Notice: Undefined index: extension .... on line 131
  Notice: Undefined index: resumeFile .... on line 135
  </code></pre>