Reputation: 85
I'm using file picker for my application. In that, I want to know picked file mime type even file name has no extension. How it is possible?
Upvotes: 4
Views: 3707
Reputation: 2609
use this package mime
You can get mime type from file path like this:
import 'package:mime/mime.dart'; .... lookupMimeType(file.path) // output: Image/Jpeg
Upvotes: 3