Closed snebjorn closed 1 year ago
See dotnet/corefx#26201 for application/json
and application/xml
I'm currently dealing with file uploads. It would be great to have MIME types for Office documents (Word, Excel).
Perhaps System.Net.Mime.MediaTypeNames
will share the same fate as System.Net.HttpStatusCode
. Which is that it's considered dead and not to be used.
https://github.com/aspnet/Mvc/issues/6997#issuecomment-384439229
Perhaps
System.Net.Mime.MediaTypeNames
will share the same fate asSystem.Net.HttpStatusCode
. Which is that it's considered dead and not to be used.
Funny that MediaTypeNames
or at least its inner classes are designed more or less the same as StatusCodes
, the replacement for HttpStatusCode
.
2019 still no application/x-www-form-urlencoded
.
Maybe class MediaTypeNames
and nested classes as partial
?
I don't think you can spread a partial
type across multiple assemblies.
This issue has been marked as up-for-grabs, but we still need to wait for the API approval, is that correct?
It's public API so strictly, yes (not sure whether https://github.com/dotnet/corefx/pull/36365 got API approval). @wfurt can share how to best do that eg with a PR.
Let me ask around @danmosemsft. The list here seems more reasonable than dotnet/corefx#36365.
Triage: We are open to add a few of the MIME type enums. Next step: Create proposal with most used ones (with some links to usage ideally) and with names how they should be exposed.
BTW might of interest to subscribers: https://github.com/dotnet/csharplang/issues/2849
With problemdetails, https://tools.ietf.org/html/rfc7807, implemented in .net core please add:
@karelz Is there a specific format example you have in mind for this proposal? What restrictions and limitations should someone interested in making a pull request be aware of?
PR is early. We need API proposal first, well thought through as suggested above: https://github.com/dotnet/runtime/issues/1489#issuecomment-537625716 The API proposal info is here: https://github.com/dotnet/runtime/blob/main/docs/project/api-review-process.md with good examples in form. Usage data will be key in this one (does not have examples in linked process)
Hello could you please add "application/merge-patch+json" ?
Hi, this seems to be a very simple change, doesn't break anything and adds useful MIME types. Why can't we get this to move forward?
@rjperes see the above discussion: https://github.com/dotnet/runtime/issues/1489#issuecomment-541385535
@karelz I am looking at the API review process you linked above, which step did this issue reach? Step one is someone creating an issue (this issue), step two is for the team to assign an owner, why hasn't that happened yet?
Here is my proposal for the common mime types that I believe should exist under the System.Net.Mime.MediaTypeNames namespace. I have checked the existing ones in the list below. I also went with the assumption that mime types of executable files will not be added, is that fair? Maybe not.
Sourced from IANA - Media Types with the help of Mozilla to pick some common mime types.
If I have missed anything that you believe is useful, add it in a comment.
@Bilal-io thanks for your proposal with names! Were you able to get some information about the usage of each of them? (as mentioned above - https://github.com/dotnet/runtime/issues/1489#issuecomment-541385535 https://github.com/dotnet/runtime/issues/1489#issuecomment-537625716) I have to admit some of these are not known to me. For some I would expect they are on decline these days (e.g. Midi?) ... some usage data would make decisions here easier.
Regarding your question:
step two is for the team to assign an owner, why hasn't that happened yet?
You are right that we deviate from the process a bit -- unless the API is super-active, we consider the area owners to be the owners (though not assigned explicitly). In case of Networking area, it is the members of our Networking team (incl. myself). Once API is ready, we discuss proposals in our team meeting to get more thoughts before marking it ready for API review. Also note that in principal we try to not assign issues unless someone works on them actively (otherwise we would be back in place where people had hundred and more issues assigned to them -- which made assignments useless). Hopefully that makes sense ...
Unable to find any usage data for MIME types. However Mozilla have a list of Common MIME types.
If it's useful as a workaround, I've implemented lots of missing MIME types in a very lightweight NuGet package (NuGet, source). (An older version is also available as an MIT-licensed gist).
I need text/csv )) Any plans?
This error has been open since 2017. It's such a small thing to add these guys. When will PNG come?
Moreover, @Bilal-io's list is no longer correct.... See this for an updatet version.
I find it rather strange that the dotnet team are still insisting on collecting usage information in order to add something like image/png
.
I find it rather strange that the dotnet team are still insisting on collecting usage information... @oobayly
As long as the MIME type does not exist, you cannot increase the number of usage... Genius idea! 😂
It's also missing the csv media type name as well.
text/json text/x-json text/javascript
application/zlib-stream
text/json text/x-json text/javascript
json isn't a text MIME type, it is an application type and is already in the API at MediaTypeNames.Application.Json
. (Source: RFC 4627 & .NET 6 Docs)
text/x-json was never ratified, nor was text/javascript.
Please add text/csv too. This issue is from 2017
https://github.com/dotnet/runtime/issues/1489#issuecomment-537625716
Triage: We are open to add a few of the MIME type enums. Next step: Create proposal with most used ones (with some links to usage ideally) and with names how they should be exposed.
@karelz I can agree that the audio, video, and office mime types have special uses and are not found in every application. But can we start with the file types used in the ASP.NET Core project templates, with the addition of related and some other well-known formats? I found most of the font and image formats there in the wwwroot
directories.
Additional sources are: IANA Media Types and ASP.NET Core FileExtensionContentTypeProvider.
The proposed list above seems quite reasonable. I can try to take it through API review @karelz. While I personally see the benefit small, the effort is also somewhat small and we get help from the community.
@wfurt yeah, if you can bring it to Networking meeting first, let's check that we have "reasonability" agreement. Then we can push it through API review. Thanks for help!
Triage: The team discussed it on Thu 3/16. There was general agreement with the latest proposal - thank you @mmarinchenko! @wfurt will update the proposal into form ready for API review and mark it as such. We should be able to get it into 8.0 without any troubles.
Triage: The team discussed it on Thu 3/16. There was general agreement with the latest proposal - thank you @mmarinchenko! @wfurt will update the proposal into form ready for API review and mark it as such. We should be able to get it into 8.0 without any troubles.
Will this include adding zlib-stream
to the class as ZlibStream
(to let the people know to use the ZlibStream class in .NET to decompress the stream data)?
I was not planning to @AraHaan. Do you have example of public sites using it or is that something you applications do internally? https://www.rfc-editor.org/rfc/rfc6713 shows application/zlib
and application/gzip
so I'm note sure from where the -stream
is coming. The mime type should be specific to the content not the implementation producing it, right?
I am not sure, it might have been a random case where I noticed an zlib-stream
version of it.
https://github.com/dotnet/corefx/blob/3f0bd5d8c3d019ad8b1561395030a58bc38ddfe9/src/System.Net.Mail/ref/System.Net.Mime.cs#L44
I tried using
System.Net.Mime.MediaTypeNames
in my asp net core api to remove "magic strings"But it's missing quite a few MIME types.
These come to mind: