title: Sonata media bundle no image preview
body: <p>I have a problem with the Sonata Media bundle. Images that i upload on server (local) are not displayed (thumbnail missing). I checked the path and it's all correct. All images that I uploaded is transferred to the directory <code>/web/ uploads/media</code> . </p>
  
  <p>Check Screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/Tx0hf.png" alt="enter image description here"></p>
  
  <p><a href="http://fotkica.com/slike.php?slika=1_142193329_Screenshot_2.png" rel="nofollow noreferrer">Full size screenshot here</a></p>
  
  <p><strong>Config File:</strong></p>
  
  <pre><code>sonata_media:
      # if you don't use default namespace configuration
      #class:
      #    media: MyVendor\MediaBundle\Entity\Media
      #    gallery: MyVendor\MediaBundle\Entity\Gallery
      #    gallery_has_media: MyVendor\MediaBundle\Entity\GalleryHasMedia
      default_context: default
      db_driver: doctrine_orm # or doctrine_mongodb, doctrine_phpcr
      contexts:
          default:  # the default context is mandatory
              providers:
                  - sonata.media.provider.dailymotion
                  - sonata.media.provider.youtube
                  - sonata.media.provider.image
                  - sonata.media.provider.file
  
              formats:
                  preview:   { width: 100, quality: 100}
                  small: { width: 100 , quality: 70}
                  big:   { width: 500 , quality: 70}
  
      cdn:
          server:
              path: uploads/media
  
      filesystem:
          local:
              directory:  %kernel.root_dir%/../web/uploads/media
              create:     false
  
  sonata_notification:
      backend: sonata.notification.backend.runtime
  
  sonata_notification:
      admin:
          enabled: false
  </code></pre>
  
  <p>Am using Media bundle in Sonata admin bundle like this and all work good but just that thumbnail is not rendered. I read Media BUndle doc Helper section but dont understand.</p>
  
  <p>In my ArticleAdmin controlir i adding filend like this:</p>
  
  <pre><code>/**
   * Configure Form Fields
   *
   * Fields to be shown on create/edit forms
   */
  protected function configureFormFields(FormMapper $formMapper)
  {
      $link_parameters = array();
  
      if ($this-&gt;hasParentFieldDescription()) {
          $link_parameters = $this-&gt;getParentFieldDescription()-&gt;getOption('link_parameters', array());
      }
  
      if ($this-&gt;hasRequest()) {
          $context = $this-&gt;getRequest()-&gt;get('context', null);
  
          if (null !== $context) {
              $link_parameters['context'] = $context;
          }
      }
  $formMapper-&gt;add('media', 'sonata_type_model_list', array('required' =&gt; false), array(
                  'link_parameters' =&gt; $link_parameters
             ))
  }
  </code></pre>
  
  <p>Any solution?</p>
  
  <hr>
  
  <h3>UPDATE:</h3>
  
  <p>In my log file, I found this :</p>
  
  <blockquote>
    <p>[2015-01-22 15:28:22] request.ERROR: Uncaught PHP Exception
    Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No
    route found for "GET
    /admin/sonata/media/media/uploads/media/default/0001/01/thumb_1_admin.jpeg""
    at C:\xampp\htdocs\Symfony\app\cache\dev\classes.php line 2017
    {"exception":"[object]
    (Symfony\Component\HttpKernel\Exception\NotFoundHttpException(code:
    0): No route found for \"GET
    /admin/sonata/media/media/uploads/media/default/0001/01/thumb_1_admin.jpeg\"
    at C:\xampp\htdocs\Symfony\app\cache\dev\classes.php:2017,
    Symfony\Component\Routing\Exception\ResourceNotFoundException(code:
    0):  at
    C:\xampp\htdocs\Symfony\app\cache\dev\appDevUrlMatcher.php:521)"}
    []</p>
  </blockquote>