title: Symfony move_uploaded_file to public resources?
body: <p>Im trying to perform a file upload and am having truble generating a route to tell the <code>move_uploaded_file</code> where to move the file. In my routing file (from within the bundle) i have:</p>
  
  <pre><code>endorsement_pics:
      pattern:  /images
      defaults: { _resource: EndorseMeEndorsementBundle/Resources/public/images/endorsement_images }
  </code></pre>
  
  <p>And i do:</p>
  
  <pre><code>        $url = $this-&gt;get('router')-&gt;generate('endorsement_pics');
  </code></pre>
  
  <p>Which generates the literal url www.example.com/endorsement/images </p>
  
  <p>And the function </p>
  
  <pre><code>            move_uploaded_file($_FILES['endorsement_image']['tmp_name'], $url."image1.jpg");
  </code></pre>
  
  <p>Which gives me the error:</p>
  
  <pre><code>                Warning: move_uploaded_file(/newsite/web/app_dev.php/endorsement/imagesimage1.jpg) [&amp;lt;a href=&amp;#039;function.move-uploaded-file&amp;#039;&amp;gt;function.move-uploaded-file&amp;lt;/a&amp;gt;]: failed to open stream: No such file or directory in /home/content/24/9254124/html/newsite/src/EndorseMe/EndorsementBundle/Controller/DefaultController.php line 20
  </code></pre>
  
  <p>Any ideas?</p>