-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path is not taking as given and downloading in Download folder only #533
Comments
i am also facing the same issue, i wanted to download a file to private storage by path provided by getApplicationSupportDirectory but the package keeps downloading to downloads folder in the external storage |
Same issue here |
i have checked the native android implementation, this isn't a bug don't know why but the path provided is ignored and is replaced by downloads media folder intentionally,
its in DownloadWorker.java |
For any one who wants to the downloaded files to private or local storage 1.go to the android implementation and look for DownloadWorkder.java file 2.look for this function addFileToDownloadsApi21 and replace its content with this
and add this to bottom fileApi21 = addFileToDownloadsApi21(filename); Also comment out a big chunk of code in => if (status == DownloadStatus.COMPLETE) {}. condition seems reckless but its a fix, you can file your files in the local storage |
Thank you @abeyshiferaw0 , works perfectly. Though I was wondering when this can be fixed in the master repo |
having same issue here, how you solve it? @abeyshiferaw0 please can you explain how to go to "go to the android implementation" ? I'm still having same problem I can't store the files into subfolder of downlad directory |
Same issue here, can someone do a fork with the fix ? ^^' |
Does it really work for you? |
yes it does work, if you only want the downloaded file to be saved on the local private storage only |
if your using android studio double click shift and search for downloadWorker.java, open the file and you can edit the changes |
https://github.com/abeyshiferaw0/flutter_downloader.git this is the fork that i used, but it is only for downloading to internal storage only just pass your desired location starting from getApplicationSupportDirectory() and it will work on both android and ios e.g /// start download with path from getSaveDir() ` |
This may be duplicate of #525. |
This is an epic fail. I have code in the field that is now downloading to the wrong directory. What in the world would make you change this behavior!!!??? |
I know this issue, it comes from updates in Android implementation due to support Scoped Storage model in Android 11. In Android 11, app can no longer create dedicated and app-specific directories with external storage. It causes P/S: for temporary solution, I publish v1.7.1 to fix the issue in case of internal storage. Use-case of external storage in Android 11, |
@hnvn you can ask for this permission to create the folder |
where can i find this file ? |
Had the same problem and fixed it.
and replace it with:
to be able to write you must have permissions: storage, manageExternalStorage, requestInstallPackages.
|
I guess removing or changing "SaveInPublicStorage" to false would save the file to your required directory. final id = await FlutterDownloader.enqueue( |
@abeyshiferaw0 |
I am getting issues while downloading videos from the server. I had given the path for Android as (
/storage/emulated/0/Movies/MyApp
) but It's downloading video in the "Download" folder only.Here is my code:
Here are the logs:
But after downloading its printing (from the library) as below:
Can you please tell me why it's downloading the video in the Download folder only? Why it's not taking the path I have given?
The text was updated successfully, but these errors were encountered: