saveDir didn't work
See original GitHub issuewhen i set savedDir=/storage/emulated/0/Android/data/vn.hunghd.example/files
but files save to /storage/emulated/0/Download/Android-Programming-Cookbook.pdf
- compileSdkVersion: 30
- android version: 11
- flutter_downloader: 1.7.0
- flutter version: 2.5.0
my code
Future<String?> _findLocalPath() async {
var externalStorageDirPath;
if (Platform.isAndroid) {
try {
// externalStorageDirPath = await AndroidPathProvider.downloadsPath;
externalStorageDirPath = (await getExternalStorageDirectory())?.path; //<-----------here
} catch (e) {
final directory = await getExternalStorageDirectory();
externalStorageDirPath = directory?.path;
}
} else if (Platform.isIOS) {
externalStorageDirPath = (await getApplicationDocumentsDirectory()).absolute.path;
}
return externalStorageDirPath;
}
logs
[+5686 ms] W/WM-WorkSpec(22928): Backoff delay duration less than minimum value
[ +35 ms] D/DownloadWorker(22928): DownloadWorker{url=http://enos.itcollege.ee/~jpoial/allalaadimised/reading/Android-Programming-Cookbook.pdf,filename=null,savedDir=/storage/emulated/0/Android/data/vn.hunghd.example/files,header={"auth": "test_for_sql_encoding"},isResume=false
[ +1 ms] D/DownloadWorker(22928): Update notification: {notificationId: 5, title: http://enos.itcollege.ee/~jpoial/allalaadimised/reading/Android-Programming-Cookbook.pdf, status: 2, progress: 0}
[ +10 ms] D/DownloadWorker(22928): Open connection to http://enos.itcollege.ee/~jpoial/allalaadimised/reading/Android-Programming-Cookbook.pdf
[ ] D/DownloadWorker(22928): Headers = {"auth": "test_for_sql_encoding"}
[ +2 ms] I/flutter (22928): Background Isolate Callback: task (384f753e-2958-4526-9fbc-9d2b12641b9d) is in status (DownloadTaskStatus(2)) and process (0)
[ +5 ms] I/flutter (22928): UI Isolate Callback: [384f753e-2958-4526-9fbc-9d2b12641b9d, DownloadTaskStatus(2), 0]
[ +690 ms] D/DownloadWorker(22928): Response with redirection code
[ ] D/DownloadWorker(22928): Location = https://enos.itcollege.ee/~jpoial/allalaadimised/reading/Android-Programming-Cookbook.pdf
[ ] D/DownloadWorker(22928): New url: https://enos.itcollege.ee/~jpoial/allalaadimised/reading/Android-Programming-Cookbook.pdf
[ ] D/DownloadWorker(22928): Open connection to https://enos.itcollege.ee/~jpoial/allalaadimised/reading/Android-Programming-Cookbook.pdf
[ +1 ms] D/DownloadWorker(22928): Headers = {"auth": "test_for_sql_encoding"}
[+1332 ms] D/DownloadWorker(22928): Content-Type = application/pdf
[ ] D/DownloadWorker(22928): Content-Length = 8620159
[ ] D/DownloadWorker(22928): Charset = null
[ ] D/DownloadWorker(22928): Content-Disposition = null
[ ] D/DownloadWorker(22928): fileName = Android-Programming-Cookbook.pdf
[ +645 ms] D/DownloadWorker(22928): Update notification: {notificationId: 5, title: Android-Programming-Cookbook.pdf, status: 2, progress: 1}
[ +3 ms] I/flutter (22928): Background Isolate Callback: task (384f753e-2958-4526-9fbc-9d2b12641b9d) is in status (DownloadTaskStatus(2)) and process (1)
[ ] I/flutter (22928): UI Isolate Callback: [384f753e-2958-4526-9fbc-9d2b12641b9d, DownloadTaskStatus(2), 1]
[+1891 ms] D/DownloadWorker(22928): Update notification: {notificationId: 5, title: Android-Programming-Cookbook.pdf, status: ...
...
...
...
[ ] I/flutter (22928): UI Isolate Callback: [384f753e-2958-4526-9fbc-9d2b12641b9d, DownloadTaskStatus(2), 100]
[ +18 ms] D/DownloadWorker(22928): File downloaded (/storage/emulated/0/Download/Android-Programming-Cookbook.pdf)
[ +3 ms] D/DownloadWorker(22928): Setting an intent to open the file /storage/emulated/0/Download/Android-Programming-Cookbook.pdf //<<<<<<<<<<------------------------here
[ ] I/flutter (22928): Background Isolate Callback: task (384f753e-2958-4526-9fbc-9d2b12641b9d) is in status (DownloadTaskStatus(3)) and process (100)
[ +1 ms] D/DownloadWorker(22928): Update too frequently!!!!, but it is the final update, we should sleep a second to ensure the update call can be processed
[ +5 ms] I/flutter (22928): UI Isolate Callback: [384f753e-2958-4526-9fbc-9d2b12641b9d, DownloadTaskStatus(3), 100]
[ +10 ms] D/MediaScannerConnection(22928): Scanned /storage/emulated/0/Download/Android-Programming-Cookbook.pdf to content://media/external_primary/file/319376
[ ] D/DownloadWorker(22928): MediaStore updated (content://media/external_primary/file/319376)
[ +985 ms] D/DownloadWorker(22928): Update notification: {notificationId: 5, title: Android-Programming-Cookbook.pdf, status: 3, progress: 100}
[ +8 ms] D/DownloadWorker(22928): File downloaded
[ +5 ms] I/WM-WorkerWrapper(22928): Worker result SUCCESS for Work [ id=384f753e-2958-4526-9fbc-9d2b12641b9d, tags={ flutter_download_task, vn.hunghd.flutterdownloader.DownloadWorker } ]
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:11 (2 by maintainers)
Top Results From Across the Web
CD (SaveDir) doesn't work in Windows 7? - Microsoft - Tek-Tips
I finally broke down and installed VFP on my Win7 machine. Cruising along fine, and then this completely unexpected error happens: This ...
Read more >r/cemu - Savedir does not appear in the program title bar, can't ...
Right-click the game in Cemus game list within Cemu and open the Save Directory option.
Read more >Top 10 Reason your Server is not working and how to fix
After helping over 600 people setup there servers, here is the top 10 reasons their servers did not work.
Read more >Save didn't work. now i can't recover my document
i copied the file to a different map. when I then reopened the file i had lost almost everything, it was a very...
Read more >phpMyAdmin "The directory you set for upload work cannot be ...
php file already contains these lines: /* * Directories for saving/loading files from server */ $cfg['UploadDir'] = ''; $cfg['SaveDir'] = '';.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just tested on these specs and still got the same issue as mentioned above:
Logs
Even though it’s written
DownloadWorker{url=https://storage.googleapis.com/vx_dev_tasks/tasks/710/INV2021015974 (1).pdf,filename=null,savedDir=/storage/emulated/0/Android/data/com.sunterra.vx.dev/files/Downloads,header=,isResume=false
, the file is not exist on thesavedDir
. The file is downloaded to/storage/emulated/0/Download/INV2021015974 (1).pdf
I’m not using android 11, so upgrading to v1.7.0 won’t fix the problem.
Also happened to me on:
But, it was previously successful:
Maybe the culprit is flutter 2.5.0