Which MIME Types can be displayed in browser
Asked Answered
O

1

6

I'm writing an internal application to serve up files to consuming applications, and I'm trying to figure out which file types can be displayed in browser.

As an Example: A .docx file cannot be displayed in browser (by default at least). If an attempt is made to display it, it would begin downloading it instead.

On the other hand, a .pdf file can be displayed in browser. You can preview the contents and display it in an object tag or an iframe tag.

So I'm wondering if there's a list of mimetypes that can be displayed in browser, or if I'll have to experiment and continuously make changes as I figure out new ones that can or cannot be displayed.

For a little more information, primarily I'll be using Chrome for this as that's my companies primary web browser. I've looked around for awhile without anything, so I thought I'd ask here.

I have looked at threads such as this one While file types can be viewed in browser, but it doesn't really answer my question.

Thanks, any help is appreciated!

Olga answered 29/6, 2018 at 18:41 Comment(1)
"a .pdf file can be displayed in browser" - not by default. I doubt that there is a standard for all browsersBatter
E
0

The following list does not claim to be exhaustive:

application/atom+xml
application/javascript
application/json
application/pdf
application/rss+xml
application/xhtml+xml
application/xml

audio/mpeg
audio/ogg
audio/wav

font/woff
font/woff2

image/bmp
image/gif
image/jpeg
image/png
image/svg+xml
image/webp
image/x-icon

text/css
text/html
text/javascript
text/plain
text/xml

video/mp4
video/ogg
video/webm
Ectomere answered 23/1 at 13:48 Comment(3)
Do you have any source that backs the claim that all of these content types can be used in all currently available browsers?Batter
@NicoHaase No, I have no source that would back the claim other then using this mime types in my projects.Ectomere
+1 There is not an exhaustive list (it varies), but this answer is the best I've seen. Note that while desktop and iOS browsers have supported PDF for a while, Chrome on mobile Android still does not :-(Nesbitt

© 2022 - 2024 — McMap. All rights reserved.