title: Download a video and automatically save in a folder
body: <p>Using php, how can I download a video from youtube and when i click save the video goes directly to a folder I have already created?</p>
  
  <p>I have this code:</p>
  
  <pre><code> &lt;label class="col-md-4" for="nome"&gt;Nome&lt;/label&gt;//name that a give to the video//
   &lt;label class="col-md-4" for="tipo"&gt;Tipo&lt;/label&gt;//extension (.wmv, .mp4)//
   &lt;div class="col-md-4"&gt;
              &lt;input type="nome" class="form-control" name="nome"/&gt;//ABC example of a name
   &lt;/div&gt;
   &lt;div class="col-md-4"&gt;
              &lt;select class="form-control" name="tipo"&gt; //extensions
              &lt;option&gt;wmv&lt;/option&gt;
              &lt;option&gt;mp4&lt;/option&gt;
              &lt;/select&gt;
   &lt;/div&gt;
   &lt;label class="col-md-4" for="url"&gt;URL&lt;/label&gt;
   &lt;label class="col-md-4" for="caminho"&gt;Caminho&lt;/label&gt;
   &lt;input type="url" class="form-control" name="url" value="&lt;?php "" 
                 ?&gt;"/&gt; //example of a Url https://www.youtube.com/embed/LsG-rvQoErk
  &lt;input type="text" class="form-control" name="caminho" value="videos2/ABC.mp4"&gt;
  </code></pre>
  
  <p>This last line "input type="text" class="form-control" name="caminho" value="videos2/ABC.mp4"" doesnt exist but when I click to save I want that the video to be saved in a folder with the name "videos2" and when I go to see the video I want to see that it is saved on the folder.</p>
  
  <p>How can I do this? Thank you</p>