title: Image uploader working perfectly for an insert form but not for an update form
body: <p>I know there are already many similar questions like this and I apologize in advance for adding to the file, but I am a little short on time to do research and I need quick help. I am trying to finish an overdue assignment and my image upload function is working perfectly when I add a product, but not when I update it. I have no idea why. My code to update the image is here:</p>
  
  <pre><code>require_once 'file-util.php'
      // Check if the file exists before setting it
      if (isset($_FILES['imageFile1'])) {
          // Retrieve the name of the file based on what it was called on the client computer
          $filename = $codeInput . '.png';
  
          // Make sure the filename exists 
          if (!empty($filename)) {
              // Store the temporary location of where the file was stored on the server
              $sourceLocation = $_FILES['imageFile1']['tmp_name'];
  
              // Build the path to the images folder and use the same filename as before
              $targetPath = $image_dir_path . DIRECTORY_SEPARATOR . $filename;
  
              // Move file from temp directory to images folder
              move_uploaded_file($sourceLocation, $targetPath);
          }
      }
  </code></pre>
  
  <p>This is the exact same code that I have in my insert_product file.</p>
  
  <p>And my file_util is here:</p>
  
  <pre><code>$image_dir = 'images';
  $image_dir_path = getcwd() . DIRECTORY_SEPARATOR . $image_dir;
  </code></pre>
  
  <p>Everything else works perfectly, but it is just this little thing that isn't seeming to do anything, so it seems to me like there's a little detail I'm missing for this to work in update_product. Is there something else I need to do to get this to work, or is it something else I'm unaware of?</p>
  
  <p>Edit: Turns out that I just forgot to set the encryption type in my add_product_form. If anyone else has this silly issue, double check your forms for this near the top of the body:</p>
  
  <pre><code>&lt;form action="insert_product.php" method="post"
                id="add_product_form"
                enctype="multipart/form-data"&gt;
  </code></pre>