Comments (2)
You can use Magic class directly(MimeGuesser it's just static facade for this class).
For example:
using (var magic = new Magic(
MagicOpenFlags.MAGIC_MIME_TYPE |
MagicOpenFlags.MAGIC_MIME_ENCODING,
null))
{
Console.WriteLine(magic.Read("/path/to/file"));
}
see magic flags for more.
from mime.
Silly me, I didn't notice that. I think this should be added to the examples in the README.
from mime.
Related Issues (20)
- Unable to load DLL 'libmagic-1' or one of its dependencies(HRESULT: 0x8007007E) HOT 9
- Excel file type is detected as "bin" HOT 4
- Please add x86 support HOT 1
- Excel files are detected as "zip" HOT 9
- file type is detected Unknown HOT 8
- All SVG are identified as text/svg instead of text/svg+xml HOT 1
- Implement magic_list
- Building this project to net 4.5/x86 specification
- Update documentation to mention that magic_open isn't thread safe (new Magic()) HOT 12
- missing alpine linux x64 support HOT 1
- Unable to find libmagic-1 on Ubuntu 20.04 HOT 5
- linux-musl-x64 is missing from runtimeTargets HOT 4
- Libmagic not compatibile with Xamarin on mobile devices
- Different results using filePath vs stream input HOT 2
- Got error with visual studio 2015 HOT 3
- Update File to version 5.41 HOT 7
- libmagic dependency mismatch on MacOS Monterey (5.41) HOT 2
- "Could not find any valid magic files!" when included in a Nuget package HOT 5
- native lib for M1 Mac os HOT 15
- Update file to 5.44 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mime.