title: DownloadManager Deletes File On Completion
body: <p>I have an app that downloads files using Android's <a href="http://developer.android.com/reference/android/app/DownloadManager.html" rel="nofollow">DownloadManager</a> to a folder on the external file storage (SD card).  This normally works fine, but there are some sources that cause the DownloadManager to trash the file when it finishes downloading it.  A good example of a source file is:</p>
  
  <p><a href="http://traffic.libsyn.com/hdtvpodcast/HDTV-2012-06-01.mp3" rel="nofollow">http://traffic.libsyn.com/hdtvpodcast/HDTV-2012-06-01.mp3</a></p>
  
  <p>It looks like maybe the problem is only with files from libsyn.com, but I'm not positive.  I've looked around for ways to change how DownloadManager handles saving files, but can't find any options in the class.</p>
  
  <p>This is where I enqueue the URL for download:</p>
  
  <pre><code>request = new Request(Uri.parse(currUrl));
  external = Uri.fromFile(externalFile);
  request.setDestinationUri(external);
  request.setVisibleInDownloadsUi(false);
  request.setNotificationVisibility(
      DownloadManager.Request.VISIBILITY_HIDDEN);
  currDownloadId = dm.enqueue(request);
  </code></pre>
  
  <p>The file locations are created using this:</p>
  
  <pre><code>Environment.getExternalStorageDirectory().getAbsolutePath() + 
      File.separator + "Podcatcher" + File.separator + "Feeds" + File.separator + 
      [int] + File.separator + [int] + [string extension];
  </code></pre>
  
  <p>Which turns out to be something like this when I query DownloadManager.COLUMN_LOCAL_FILENAME column from DownloadManager:</p>
  
  <pre><code>/mnt/sdcard/Podcatcher/Feeds/19/225.mp3
  </code></pre>
  
  <p>Most of the files are fine and persist after download, but not in this case.  Any ideas about how I can force DownloadManager to leave the file after it is downloaded?</p>
  
  <p>EDIT: I neglected to mention that when I use the standalone Download Manager when downloading this file from a browser that it reports failed at the end of the download.  Perhaps my only solution is to download it from scratch, without DownloadManager?</p>