Initial commit
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MimeMapping</id>
|
||||
<version>2.0.0</version>
|
||||
<authors>Matthew Little</authors>
|
||||
<license type="expression">MIT</license>
|
||||
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
|
||||
<readme>README.md</readme>
|
||||
<projectUrl>https://github.com/zone117x/MimeMapping</projectUrl>
|
||||
<description>Constants for (almost) all MIME types and method to determine MIME type from a file name.
|
||||
Contains just over 1000 mime types.
|
||||
|
||||
The Dictionary is generated from the jshttp/mime-db db.json file.
|
||||
Works similar to .NET's System.Web.MimeMapping.GetMimeMapping.
|
||||
|
||||
It aggregates data from the following sources:
|
||||
https://www.iana.org/assignments/media-types/media-types.xhtml
|
||||
https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
|
||||
https://hg.nginx.org/nginx/raw-file/default/conf/mime.types
|
||||
|
||||
See:
|
||||
https://github.com/jshttp/mime-db#mime-db
|
||||
https://learn.microsoft.com/dotnet/api/system.web.mimemapping.getmimemapping</description>
|
||||
<tags>mimetype contenttype mime type mimemapping GetMimeMapping media-types rfc 4288</tags>
|
||||
<repository type="git" url="https://github.com/zone117x/MimeMapping" commit="9b864d405dea0abc3a28b6add82e433b5c1101fe" />
|
||||
<dependencies>
|
||||
<group targetFramework=".NETFramework4.6.1" />
|
||||
<group targetFramework=".NETStandard2.0" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
</package>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb464c908646e4541ae10ee2e3219e0e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
# MimeMapping
|
||||
|
||||
[](https://www.nuget.org/packages/MimeMapping/)
|
||||
[](https://www.nuget.org/packages/MimeMapping/)
|
||||
[](https://github.com/zone117x/MimeMapping/actions/workflows/build.yml)
|
||||
[](https://codecov.io/github/zone117x/MimeMapping)
|
||||
|
||||
Constants for (almost) all MIME types and method to determine MIME type from a file name.
|
||||
Contains just over 1000 mime types.
|
||||
|
||||
The Dictionary is generated from the [`jshttp/mime-db`](https://github.com/jshttp/mime-db#mime-db) `db.json`.
|
||||
Works similar to .NET's [System.Web.MimeMapping.GetMimeMapping](https://learn.microsoft.com/dotnet/api/system.web.mimemapping.getmimemapping).
|
||||
|
||||
It aggregates data from the following sources:
|
||||
|
||||
- <https://www.iana.org/assignments/media-types/media-types.xhtml>
|
||||
- <https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types>
|
||||
- <https://hg.nginx.org/nginx/raw-file/default/conf/mime.types>
|
||||
|
||||
The library is just a literal C# `Dictionary<string, string>` with over 1000 entries, and a helper method that can be passed a file path.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```C#
|
||||
string myFile = "myimage.jpg";
|
||||
string mimeType = MimeMapping.MimeUtility.GetMimeMapping(myFile);
|
||||
Console.WriteLine(mimeType); // output: image/jpeg
|
||||
|
||||
string randomFile = "data.asdf";
|
||||
string mimeType = MimeMapping.MimeUtility.GetMimeMapping(randomFile);
|
||||
Console.WriteLine(mimeType); // output: application/octet-stream
|
||||
|
||||
string rawExtension = "json";
|
||||
string mimeType = MimeMapping.MimeUtility.GetMimeMapping(rawExtension);
|
||||
Console.WriteLine(mimeType); // output: application/json
|
||||
|
||||
|
||||
// List all types..
|
||||
foreach(var kp in MimeMapping.MimeTypes.TypeMap)
|
||||
{
|
||||
Console.WriteLine($"File extension: {kp.Key}, mime string: {kp.Value}");
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76986b3c44ab09944b8d454e3e8273b6
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 838b93022cc1e424a8d74a0b91e9823f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce25f22f090129c46a878cfb1f417c62
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5bd87d84e0729643b3d2142fd6b0299
|
||||
labels:
|
||||
- NuGetForUnity
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 3
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
Any:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
Editor:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
WindowsStoreApps:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb4b40301ae7992499c959cf01e5d173
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user