I download files from FTP and store them in cache directory using path_provider package
Future<void> _fileMock(String strFileName) async {
try {
final Directory appDocDir = await getTemporaryDirectory()..createSync(recursive: true);
String appDocPath = appDocDir.path;
print('appDocPath : $appDocPath');
_file = File('$appDocPath/$strFileName');
setSavePath('$appDocPath/$strFileName');
print('file : $file');
}catch(e){
print('_fileMock Error : ${e.toString()}');
final File file = File('');
}
}
The path to the cache directory is /data/user/0/package name/cache/fileName
The file will download normally.
I want to copy or download files from the cache directory to the download directory. Attach an image.
