Aspsine / MultiThreadDownload

Android Multi-Thread Download library
908 stars 285 forks source link

can not start Downloading File when set path private folder in Sd card #75

Open sajadmartiny opened 8 years ago

sajadmartiny commented 8 years ago

When you download a file size of 1 GB is greater ,status in connection mode and do not start downloading and return error ,any solution for it?

return java.io.IOException: unexpected end of stream in onFailed

salehmosleh commented 7 years ago

use below codes to get external sdcard space : for your app , android OS just allow you to access to your app data folder in external sdcard , not root of it.

          File[] Dirs = ContextCompat.getExternalFilesDirs(that, null);
            if (Dirs.length > 1) {
                setDownloadDirectory(Dirs[1].getAbsolutePath());
            } else {
                Toast.makeText(that, "can not find external sdcard !", Toast.LENGTH_LONG).show();
            }