Save files to cache with the extension

This commit is contained in:
Vishnu Mohandas 2020-09-17 19:59:42 +05:30
parent eb813699f0
commit 6d8e7c1a43

View file

@ -152,7 +152,9 @@ Future<io.File> _downloadAndDecrypt(File file, BaseCacheManager cacheManager,
final data =
await CryptoUtil.decryptFileToData(temporaryPath, file.getPassword());
io.File(temporaryPath).deleteSync();
return cacheManager.putFile(file.getDownloadUrl(), data);
final fileExtension = extension(file.title).substring(1).toLowerCase();
return cacheManager.putFile(file.getDownloadUrl(), data,
fileExtension: fileExtension);
});
}