title: MVC Symfony2 save image as blob in database
body: <p>Documentation on this subject is rather scarce, and I can't find anything other than their documentation (<a href="http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html" rel="nofollow">http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html</a>) on how to save just the relative path in the database and have the actual image on the webserver.</p>
  
  <pre><code>/**
   * @ORM\Column(name="photo", type="blob", nullable=true)
   */
  private $photo;
  </code></pre>
  
  <p>Do you declare that in your entity and generate getter/setters like you would with a regular variable? How do you get the data from the POST request in your controller and call the model function in order to save the BLOB to the database?</p>
  
  <p>Thanks.</p>