title: File can be opened in FTP but not in HTTP after upload from site
body: <p>I am writing a PHP script that enables a user to upload a picture and then displays it on their page. Everything works fine up until the part where they need to display it. I run the form and submit it and the picture shows up in the directory in my FTP. I can download that file from the FTP and view it on my computer. I can visit the FTP url of that image, login and see it fine.</p>
  
  <p>When I go to the HTTP version of the exact same URL, I get a 404 error. I have checked the permissions on the folder and it's ok to read and write for a user. I even checked the permissions on the file itself after it's uploaded and it's fine. Here's my PHP code when uploading the file:</p>
  
  <pre><code>&lt;?php
  include('connect.php');
  $user_id = $_SESSION['user_id'];
  if($_POST['submit']){
  //GET FILE ATTRIBUTES
  $name = $_FILES['myfile']['name'];
  $size = $_FILES['myfile']['size'];
  $tmp_name = $_FILES['myfile']['tmp_name'];
  
  if ($name){
  //start upload process
  $location = "pics/$name";
  move_uploaded_file($tmp_name,$location);
  
  $sql = "UPDATE tbl_name SET imagelocation='$location' WHERE user_id='$user_id'";
  $query = $mysqli-&gt;query($sql);
  
  header('location:profile.php');
  }
  else{
  die("Please select a file! &lt;a href='profile.php'&gt;GO BACK&lt;/a&gt;");
  }
  }
  ?&gt;
  </code></pre>
  
  <p>Any idea what this could be? I haven't seen this problem before.</p>