HTTP content-type


Release date:2024-02-27 Update date:2024-02-27 Editor:admin View counts:226

Label:

HTTP content-type

Content-Type (content type), which generally refers to the Content-Type used to define the type of web file and the encoding of the web page,and to determine what form and encoding the browser will read the file, which is why you often see some PHP pages click only to download a file or apicture.

The Content-Type header tells the client the type of content that is actually returned.

Syntax format:

Content-Type: text/html; charset=utf-8
Content-Type: multipart/form-data; boundary=something

Example:

Image0

Common media formats are as follows:

  • Text/html: HTML format

  • Text/plain: plain text format

  • Text/xml: XML format

  • Image/gif: gif picture format

  • Image/jpeg: jpg picture format

  • Image/png:png picture format

Type of media format that begins with application:

  • Application/xhtml+xml: XHTML format

  • Application/xml: XML data format

  • Application/atom+xml: Atom XML aggregation format

  • Application/json: JSON data format

  • Application/pdf:pdf format

  • Application/msword: Word document format

  • Application/octet-stream: binary stream data (such as common file downloads)

  • The default encType,form form data in application/x-www-form-urlencoded: < form encType= “> is encoded and sent to the server in key/value format (theform’s default format for submitting data)

Another common media format is used when uploading files:

  • Multipart/form-data: this format is required when you need to upload files in the form

HTTP content-type comparison table

File extension

Content-Type (Mime-Type)

File extension

Content-Type (Mime-Type)

.* (binary stream, do not know the download file type)

Application/octet-stream

.tif

Image/tiff

.0.001

Application/x-001

0.301

Application/x-301

.0.323

Text/h323

0.906

Application/x-906

.0.907

Drawing/907

.a11

Application/x-a11

.acp

audio/x-mei-aac

.ai

Application/postscript

.aif

Audio/aiff

.aifc

Audio/aiff

.aiff

Audio/aiff

.anv

Application/x-anv

.asa

Text/asa

.asf

Video/x-ms-asf

.asp

Text/asp

.asx

Video/x-ms-asf

.au

Audio/basic

.avi

Video/avi

.awf

application/vnd.adobe.workflow

.biz

Text/xml

.bmp

application/x-bmp

.bot

Application/x-bot

.c4t

Application/x-c4t

.c90

Application/x-c90

.cal

Application/x-cals

.cat

Application/vnd.ms-pki.seccat

.cdf

Application/x-netcdf

.cdr

application/x-cdr

.cel

Application/x-cel

.cer

Application/x-x509-ca-cert

.cg4

Application/x-g4

.cgm

pplication/x-cgm

.cit

Application/x-cit

.class

Java/*

.cml

Text/xml

.cmp

Application/x-cmp

.cmx

application/x-cmx

.cot

Application/x-cot

.crl

Application/pkix-crl

.crt

Application/x-x509-ca-cert

.csi

Application/x-csi

.css

Text/css

.cut

Application/x-cut

.dbf

Application/x-dbf

.dbm

Application/x-dbm

.dbx

Application/x-dbx

.dcd

Text/xml

.dcx

Application/x-dcx

.der

Application/x-x509-ca-cert

.dgn

Application/x-dgn

.dib

application/x-dib

.dll

Application/x-msdownload

.doc

Application/msword

.dot

Application/msword

.drw

Application/x-drw

.dtd

Text/xml

.dwf

Model/vnd.dwf

.dwf

Application/x-dwf

.dwg

Application/x-dwg

.dxb

Application/x-dxb

.dxf

application/x-dxf

.edn

application/vnd.adobe.edn

.emf

Application/x-emf

.eml

Message/rfc822

.ent

Text/xml

.epi

application/x-epi

.eps

Application/x-ps

.eps

Application/postscript

.etd

Application/x-ebx

.exe

Application/x-msdownload

.fax

Image/fax

.fdf

application/vnd.fdf

.fif

application/fractals

.fo

Text/xml

.frm

Application/x-frm

.g4

Application/x-g4

.gbr

Application/x-gbr

.

Application/x-

.gif

Image/gif

.gl2

Application/x-gl2

.gp4

Application/x-gp4

.hgl

Application/x-hgl

.hmr

Application/x-hmr

.hpg

Application/x-hpgl

.hpl

Application/x-hpl

.hqx

Application/mac-binhex40

.hrf

Application/x-hrf

.hta

Application/hta

.htc

Text/x-component

.htm

Text/html

.html

Text/html

.htt

Text/webviewhtml

.htx

Text/html

.icb

Application/x-icb

.ico

Image/x-icon

.ico

Application/x-ico

.iff

Application/x-iff

.ig4

Application/x-g4

.igs

Application/x-igs

.iii

Application/x-iphone

.img

Application/x-img

.ins

Application/x-internet-signup

.isp

Application/x-internet-signup

.IVF

Video/x-ivf

.java

Java/*

.jfif

Image/jpeg

.jpe

Image/jpeg

.jpe

application/x-jpe

.jpeg

Image/jpeg

.jpg

Image/jpeg

.jpg

Application/x-jpg

.js

Application/x-javascript

.jsp

Text/html

.la1

audio/x-liquid-file

.lar

Application/x-laplayer-reg

.latex

Application/x-latex

.lavs

Audio/x-liquid-secure

.lbm

application/x-lbm

.lmsff

Audio/x-la-lms

.ls

Application/x-javascript

.ltr

Application/x-ltr

.m1v

Video/x-mpeg

.m2v

Video/x-mpeg

.m3u

Audio/mpegurl

.m4e

Video/mpeg4

.mac

Application/x-mac

.man

Application/x-troff-man

.math

Text/xml

.mdb

Application/msaccess

.mdb

Application/x-mdb

.mfp

application/x-shockwave-flash

.mht

Message/rfc822

.mhtml

Message/rfc822

.mi

Application/x-mi

.mid

Audio/mid

.midi

Audio/mid

.mil

application/x-mil

.mml

Text/xml

.mnd

Audio/x-musicnet-download

.mns

Audio/x-musicnet-stream

.mocha

Application/x-javascript

.movie

video/x-sgi-movie

.mp1

Audio/mp1

.mp2

Audio/mp2

.mp2v

Video/mpeg

.mp3

audio/mp3

.mp4

Video/mpeg4

. mpa

Video/x-mpg

.mpd

Application/vnd.ms-project

.mpe

Video/x-mpeg

.mpeg

Video/mpg

.mpg

Video/mpg

.mpga

Audio/rn-mpeg

.mpp

Application/vnd.ms-project

.mps

Video/x-mpeg

.mpt

Application/vnd.ms-project

.mpv

Video/mpg

.mpv2

Video/mpeg

.mpw

Application/vnd.ms-project

.mpx

Application/vnd.ms-project

.mtx

Text/xml

.mxp

Application/x-mmxp

.net

Image/pnetvue

.nrf

Application/x-nrf

.nws

Message/rfc822

.odc

Text/x-ms-odc

.out

Application/x-out

.p10

Application/pkcs10

.p12

application/x-pkcs12

.p7b

Application/x-pkcs7-certificates

.p7c

Application/pkcs7-mime

.p7m

Application/pkcs7-mime

.p7r

Application/x-pkcs7-certreqresp

.p7s

Application/pkcs7-signature

.pc5

Application/x-pc5

.pci

Application/x-pci

.pcl

Application/x-pcl

.pcx

Application/x-pcx

.pdf

Application/pdf

.pdf

Application/pdf

.pdx

application/vnd.adobe.pdx

.pfx

application/x-pkcs12

.pgl

application/x-pgl

.pic

Application/x-pic

.pko

Application/vnd.ms-pki.pko

.pl

Application/x-perl

.plg

Text/html

.pls

Audio/scpls

.plt

Application/x-plt

.png

Image/png

.png

Application/x-png

.pot

application/vnd.ms-powerpoint

.ppa

application/vnd.ms-powerpoint

.ppm

Application/x-ppm

.pps

application/vnd.ms-powerpoint

.ppt

application/vnd.ms-powerpoint

.ppt

Application/x-ppt

.pr

application/x-pr

.prf

Application/pics-rules

.prn

Application/x-prn

.prt

Application/x-prt

.ps

Application/x-ps

.ps

Application/postscript

.ptn

Application/x-ptn

.pwz

application/vnd.ms-powerpoint

.r3t

Text/vnd.rn-realtext3d

.ra

Audio/vnd.rn-realaudio

.ram

audio/x-pn-realaudio

.ras

Application/x-ras

.rat

Application/rat-file

.rdf

Text/xml

.rec

Application/vnd.rn-recording

.red

Application/x-red

.rgb

Application/x-rgb

.rjs

Application/vnd.rn-realsystem-rjs

.rjt

application/vnd.rn-realsystem-rjt

.rlc

Application/x-rlc

.rle

Application/x-rle

.rm

Application/vnd.rn-realmedia

.rmf

application/vnd.adobe.rmf

.rmi

Audio/mid

.rmj

Application/vnd.rn-realsystem-rmj

.rmm

audio/x-pn-realaudio

.rmp

Application/vnd.rn-rn_music_package

.rms

Application/vnd.rn-realmedia-secure

.rmvb

application/vnd.rn-realmedia-vbr

.rmx

Application/vnd.rn-realsystem-rmx

.rnx

Application/vnd.rn-realplayer

.rp

Image/vnd.rn-realpix

.rpm

Audio/x-pn-realaudio-plugin

.rsml

Application/vnd.rn-rsml

.rt

Text/vnd.rn-realtext

.rtf

Application/msword

.rtf

application/x-rtf

.rv

Video/vnd.rn-realvideo

.sam

Application/x-sam

.sat

Application/x-sat

.sdp

Application/sdp

.sdw

Application/x-sdw

.sit

Application/x-stuffit

.slb

Application/x-slb

.sld

Application/x-sld

.slk

Drawing/x-slk

.smi

Application/smil

.smil

Application/smil

.smk

application/x-smk

.snd

Audio/basic

.sol

Text/plain

.sor

Text/plain

.spc

Application/x-pkcs7-certificates

.spl

Application/futuresplash

.spp

Text/xml

.ssm

Application/streamingmedia

.sst

Application/vnd.ms-pki.certstore

.stl

Application/vnd.ms-pki.stl

.stm

Text/html

.sty

application/x-sty

.svg

Text/xml

.swf

application/x-shockwave-flash

.tdf

Application/x-tdf

.tg4

Application/x-tg4

.tga

Application/x-tga

.tif

Image/tiff

.tif

Application/x-tif

.tiff

Image/tiff

.tld

Text/xml

.top

Drawing/x-top

.torrent

application/x-bittorrent

.tsd

Text/xml

.txt

Text/plain

.uin

Application/x-icq

.uls

Text/iuls

.vcf

Text/x-vcard

.vda

Application/x-vda

.vdx

application/vnd.visio

.vml

Text/xml

.vpg

Application/x-vpeg005

.vsd

application/vnd.visio

.vsd

application/x-vsd

.vss

application/vnd.visio

.vst

application/vnd.visio

.vst

Application/x-vst

.vsw

application/vnd.visio

.vsx

application/vnd.visio

.vtx

application/vnd.visio

.vxml

Text/xml

.wav

Audio/wav

.wax

Audio/x-ms-wax

.wb1

Application/x-wb1

.wb2

Application/x-wb2

.wb3

Application/x-wb3

.wbmp

image/vnd.wap.wbmp

.wiz

Application/msword

.wk3

Application/x-wk3

.wk4

Application/x-wk4

.wkq

Application/x-wkq

.wks

application/x-wks

.wm

Video/x-ms-wm

.wma

Audio/x-ms-wma

.wmd

Application/x-ms-wmd

.wmf

Application/x-wmf

.wml

text/vnd.wap.wml

.wmv

Video/x-ms-wmv

.wmx

Video/x-ms-wmx

.wmz

application/x-ms-wmz

.wp6

Application/x-wp6

.wpd

Application/x-wpd

.wpg

Application/x-wpg

.wpl

application/vnd.ms-wpl

.wq1

Application/x-wq1

.wr1

Application/x-wr1

.wri

Application/x-wri

.wrk

application/x-wrk

.ws

Application/x-ws

.ws2

Application/x-ws

.wsc

Text/scriptlet

.wsdl

Text/xml

.wvx

video/x-ms-wvx

.xdp

application/vnd.adobe.xdp

.xdr

Text/xml

.xfd

application/vnd.adobe.xfd

.xfdf

application/vnd.adobe.xfdf

.xhtml

Text/html

.xls

Application/vnd.ms-excel

.xls

Application/x-xls

.xlw

Application/x-xlw

.xml

Text/xml

.xpl

Audio/scpls

.xq

Text/xml

.xql

Text/xml

.xquery

Text/xml

.xsd

Text/xml

.xsl

Text/xml

.xslt

Text/xml

.xwd

application/x-xwd

.x_b

Application/x-x_b

.sis

application/vnd.symbian.install

.sisx

application/vnd.symbian.install

.x_t

Application/x-x_t

.ipa

application/vnd.iphone

.apk

Application/vnd.android.package-archive

.xap

Application/x-silverlight-app

Powered by TorCMS (https://github.com/bukun/TorCMS).