title: How can i upload a photo in a database with just holding on the the file name as a VARCHAR?
body: <p>So i do not want to store a photo in the database because that takes too much memory storage.  I want to hold the file name and then use that name to access the photo.  how can i do this? here is my code so far but it does not work.  In this code i am trying to make a folder in filezilla my target folder.  right now <code>move_upload_file()</code> is returning false, what can i do to make it return true? I haven't implemented the database yet but when i do how would i be able to take the string of the file name and access the photo?
  My html:</p>
  
  <pre><code>&lt;form method="post" action="BugReport.php" enctype="multipart/form-data"&gt;
                  &lt;div style = 'margin: 10px 225px 0px 225px;'&gt;&lt;input type="hidden" name="size" value="350000"&gt;
                  &lt;input type="file" name="photo"&gt; &lt;/div&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>My php:     </p>
  
  <pre><code>//This is the directory where images will be saved
  $target = "http://TheUrlIWantToUploadTo/Internship_Program/Edward/Project_5/Project_5/Output";
  $target = $target . basename( $_FILES['photo']['name']);
  
  $pic=($_FILES['photo']['name']);
  
  
  //Writes the photo to the server
  if(move_uploaded_file($_FILES['photo']['tmp_name'], $target))
  {
  //Tells you if its all ok
  echo "The file ". basename( $_FILES['photo']['name']). " has been uploaded, and your information has been added to the directory";
  }
  else {
  //Gives and error if its not
  echo "Sorry, there was a problem uploading your file.";
  }
  </code></pre>