Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
738 stars 427 forks source link

[Feature request] override extension file #430

Open jvinai opened 9 months ago

jvinai commented 9 months ago

I need to enforce a specific extension to the cached file whatever the MIME type of the file is.

It would be nice to have an option for that, for example:

var file = await DefaultCacheManager().getSingleFile(url, {extension: 'my'});

The end result with be a path with file:///somewhere/in/the/phone/myfile.my.

Thank you!

abdushkur commented 3 months ago

I am facing same problem with FireStorage files, download files are stored in cache like this: image these files were mp4, but firebase adds signed key for viewing these files, so when saving these files its extension isn't based on mime type but requested url, if specifying its extension would solve this , then I'd be able load this file to video player.