title: Get file name from headers with DownloadManager in Android
body: <p>I'm using DownloadManager to download video files from a url.</p>
  
  <p>The problem is if I use the default folder to download the file I can not see the video in the galery.</p>
  
  <p>Also, If I try to use this method:</p>
  
  <pre><code>request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, 'filename');
  </code></pre>
  
  <p>I need to know the file name <em>before</em> download which in this case, <strong>I don't</strong>.</p>
  
  <p>And also, I don't have the name of the file in the url.</p>
  
  <p>How can I do to get the file name from the headers and pass the name to the method  setDestinationInExternalPublicDir ? 
  Other alternatives?</p>