title: Changing a Filename on Upload
body: <p>I am trying to figure out how to rename the photo that is being uploaded to my server via the code below. I am able to properly upload the photo, but I can't figure out how to change the name.</p>
  
  <p>For example, how would I rename the photo so that it would be called "renamed_image"?</p>
  
  <p>Thank you!</p>
  
  <pre><code>&lt;?php
      $target_path = "./user_photos/";  
  
      $target_path = $target_path . basename( $_FILES['picture']['name']);  
  
      if(move_uploaded_file($_FILES['picture']['tmp_name'], $target_path)) {  
      echo "The file ".  basename( $_FILES['picture']['name'])." has been uploaded";  
      } else{  
      echo "There was an error uploading the file, please try again!";  
      } 
   ?&gt;
  </code></pre>