Android Download Manager setDestinationInExternalFilesDir Android Download Manager setDestinationInExternalFilesDir android android

Android Download Manager setDestinationInExternalFilesDir


Add the permission in manifest file

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />


Why don't you use absolute path for ExternalFileDir

File sdCard = Environment.getExternalStorageDirectory();String folder = sdCard.getAbsolutePath() + "/YourFolder" ;File dir = new File(folder );if (!dir.exists()) {if (dir.mkdirs()) {    Log.i(Tag,"Directory  Created");    }}

I guess this might even work for you.


use request.setDestinationInExternalPublicDir("/folder", "FileName.extention");

this worked for me..