title: Codeigniter 4: Uploading files with move_uploaded_file
body: <p>I just started moving CodeIgniter 3 project to CodeIgniter 4. </p>
  
  <p>Everything works fine except file upload. </p>
  
  <p>I would like to keep the user uploaded files in /writable/uploads. Below is the code I use to move the uploaded file to desired location.</p>
  
  <pre><code>            $target_dir = '/writable/uploads/recordings/';
              $target_file = $target_dir . basename($_FILES["gfile"]["name"]);
              $FileType = pathinfo($target_file,PATHINFO_EXTENSION);
  
              if($FileType != "mp3") {            
               $vmuploadOk = 1;
              }               
              else
               $vmuploadOk = 1;   
  
  
              if ($vmuploadOk == 1) {
                  $greetfile = $id . "g" . basename($_FILES["gfile"]["name"]);
  
                  $target_filenew = $target_dir . $greetfile;     
  
                  move_uploaded_file($_FILES["gfile"]["tmp_name"], $target_filenew);                 
              }
  </code></pre>
  
  <p>I assume that it is because CI4 keeps writable folder outside public folder. </p>