flutter_downloader
flutter_downloader copied to clipboard
Downloader not working for dynamic zip / generated zip download [file getting download at specified path but it is corrupted. ]. Direct zip link it is
I am using flutter_downloader in conjuction with flutter_inappwebview
filePath =
(await getExternalStorageDirectory()).path;
print("onDownloadStart $url and path $filePath");
final taskId = await FlutterDownloader.enqueue(
fileName: "offlineaadhaar.zip",
// headers: {"Content-Type":"application/octet-stream"},
url: url.toString(),
savedDir: filePath,
showNotification: true,
// show download progress in status bar (for Android)
openFileFromNotification:
true, // click on notification to open downloaded file (for Android)
);
print("on Download Task Id: $taskId")
},
file getting download at specified path but it is corrupted.

https://github.com/fluttercommunity/flutter_downloader/issues/43 i seen this part as my solution but here zip file is direct link not the generated and sent over response.
When I closely look at the file downloaded its downloading html page.
tried all header
```
final taskId = await FlutterDownloader.enqueue(
fileName: "offlineaadhaar20210405043704081.zip",
headers: {
"Cache-Control":
"no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
"Connection": "Keep-Alive",
"Content-Disposition":
"attachment; filename=offlineaadhaar20210405043704081.zip",
//"Content-Length": "-1",
"Content-Transfer-Encoding": "Binary",
"Content-Type": "application/zip",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "sameorigin",
"X-XSS-Protection": "1;mode=block"
},
url: url.toString(),
savedDir: filePath,
showNotification: true,
// show download progress in status bar (for Android)
openFileFromNotification:
true, // click on notification to open downloaded file (for Android)
);
Any updates on this ??