title: What is the most secure method to upload image file to server with PHP?
body: <p>I know this topic is widely talked about. I've done my research, and decided to store image files onto the server instead of the DB as a blob file. The problem that I am having is trying to figure out the best way to upload the file, store it in a designated folder then storing the destination in the db..say../img/something.jpg - I've tried looking through many resources but most of them are missing some important steps in the process. </p>
  
  <p><strong>Problems:</strong></p>
  
  <ol>
  <li>Finding a secure way for uploading the img file</li>
  <li>Limiting the file</li>
  <li>size Uploading the image to a destination file </li>
  <li>Storing the destination file as a text in the DB</li>
  </ol>
  
  <p>I'm using PHP and MySQL.</p>