File Transfer tool php file upload suffix name and file type table almost covers all files

Source: Internet
Author: User
Tags bmp image learn php php file upload pkcs12 pkcs7 rfc822 gtar
There are many php file upload class, File upload processing is a feature of PHP (at least the manual is to be shown as PHP features, the individual think PHP in the array of excellent features more features), learn PHP people know how to upload files, But many people in programming may overlook some of the details of the file type (MIME). Before the form submits the file to PHP for processing, the browser resolves to identify what type of file is on one side, and then into the PHP processing, and PHP will identify the original type of parsing the file (not what suffix you changed to what file). In this process, there will be some browser-compatible, more accurately, the file type resolution identity inconsistency problem. This way in the PHP processing post to the file type will need to make more judgments according to different browsers, the most typical is the difference between IE and Firefox.
PHP Upload image file (Gif,jpg,bmp,png,psd,ico)
History of the most complete Oophper pro-test version of the php file upload file type corresponding table, ie, Firefox one copy.
Ie Firefox
ID suffix name file types recognized by PHP
0 Gif Image/gif
1 Jpg Image/jpeg
2 Png Image/png
3 Bmp Image/bmp
4 Psd Application/octet-stream
5 Ico Image/x-icon
6 rar Application/octet-stream
7 Zip Application/zip
8 7z Application/octet-stream
9 Exe Application/octet-stream
10 Avi Video/avi
11 rmvb Application/vnd.rn-realmedia-vbr
12 3gp Application/octet-stream
13 flv Application/octet-stream
14 mp3 Audio/mpeg
15 Wav Audio/wav
16 Krc Application/octet-stream
17 lRC Application/octet-stream
18 Txt Text/plain
19 Doc Application/msword
20 Xls Application/vnd.ms-excel
21st Ppt Application/vnd.ms-powerpoint
22 Pdf Application/pdf
23 Chm Application/octet-stream
24 Mdb Application/msaccess
25 Sql Application/octet-stream
26 Con Application/octet-stream
27 Log Text/plain
28 Dat Application/octet-stream
29 Ini Application/octet-stream
30 Php Application/octet-stream
31 Html Text/html
32 Htm Text/html
33 Ttf Application/octet-stream
34 fon Application/octet-stream
35 Js Application/x-javascript
36 Xml Text/xml
37 Dll Application/octet-stream
38 Dll Application/octet-stream
ID suffix name file types recognized by PHP
0 Gif Image/gif
1 Jpg Image/pjpeg
2 Png Image/x-png
3 Bmp Image/bmp
4 Psd Application/octet-stream
5 Ico Image/x-icon
6 rar Application/octet-stream
7 Zip Application/x-zip-compressed
8 7z Application/octet-stream
9 Exe Application/octet-stream
10 Avi Video/avi
11 rmvb Application/vnd.rn-realmedia-vbr
12 3gp Application/octet-stream
13 flv Application/octet-stream
14 mp3 Audio/mpeg
15 Wav Audio/wav
16 Krc Application/octet-stream
17 lRC Application/octet-stream
18 Txt Text/plain
19 Doc Application/msword
20 Xls Application/vnd.ms-excel
21st Ppt Application/vnd.ms-powerpoint
22 Pdf Application/pdf
23 Chm Application/octet-stream
24 Mdb Application/msaccess
25 Sql Text/plain
26 Con Application/octet-stream
27 Log Text/plain
28 Dat Text/plain
29 Ini Application/octet-stream
30 Php Application/octet-stream
31 Html Text/html
32 Htm Text/html
33 Ttf Application/octet-stream
34 fon Application/octet-stream
35 Js Text/html
36 Xml Text/xml
37 Dll Application/octet-stream
38 Class Application/java
* Application/octet-stream//Application
323 text/h323
Acx Application/internet-property-stream
Ai Application/postscript
AIF Audio/x-aiff
AIFC Audio/x-aiff
AIFF Audio/x-aiff
ASF VIDEO/X-MS-ASF
ASR VIDEO/X-MS-ASF
ASX video/x-ms-asf
Au audio/basic
Avi Video/x-msvideo
AXS Application/olescript
Bas Text/plain
Bcpio Application/x-bcpio
Bin Application/octet-stream
BMP Image/bmp
C Text/plain
Cat Application/vnd.ms-pkiseccat
CDF APPLICATION/X-CDF
CER Application/x-x509-ca-cert
Class Application/octet-stream
CLP Application/x-msclip
CMX IMAGE/X-CMX
Cod image/cis-cod
Cpio Application/x-cpio
CRD Application/x-mscardfile
CRL APPLICATION/PKIX-CRL
CRT Application/x-x509-ca-cert
CSH application/x-csh
CSS Text/css
DCR Application/x-director
Der Application/x-x509-ca-cert
Dir application/x-director
DLL Application/x-msdownload
DMS Application/octet-stream
Doc Application/msword
Dot Application/msword
DVI Application/x-dvi
DXR Application/x-director
EPS Application/postscript
ETX Text/x-setext
Evy Application/envoy
EXE Application/octet-stream
Fif Application/fractals
FLR X-WORLD/X-VRML
GIF image/gif
Gtar Application/x-gtar
GZ Application/x-gzip
H Text/plain
HDF APPLICATION/X-HDF
HLP Application/winhlp
HQX application/mac-binhex40
HTA Application/hta
HTC Text/x-component
HTM text/html
HTML text/html
HTT text/webviewhtml
ICO Image/x-icon
Ief Image/ief
III Application/x-iphone
INS Application/x-internet-signup
ISP Application/x-internet-signup
JFIF Image/pipeg
JPE Image/jpeg
JPEG Image/jpeg
JPG Image/jpeg
JPG Image/pjpeg
JS Application/x-javascript
Latex Application/x-latex
LHA Application/octet-stream
LSF video/x-la-asf
LSX video/x-la-asf
LZH Application/octet-stream
M13 Application/x-msmediaview
M14 Application/x-msmediaview
M3U Audio/x-mpegurl
Mans Application/x-troff-man
MDB application/x-msaccess
Me Application/x-troff-me
MHT message/rfc822
MHTML message/rfc822
Mid Audio/mid
Mny Application/x-msmoney
MOV video/quicktime
Movie Video/x-sgi-movie
MP2 Video/mpeg
MP3 Audio/mpeg
MPA video/mpeg
MPE Video/mpeg
MPEG Video/mpeg
MPG video/mpeg
MPP Application/vnd.ms-project
Mpv2 Video/mpeg
Ms Application/x-troff-ms
MVB Application/x-msmediaview
NWS message/rfc822
ODA Application/oda
P10 APPLICATION/PKCS10
P12 APPLICATION/X-PKCS12
P7B application/x-pkcs7-certificates
p7c Application/x-pkcs7-mime
p7m Application/x-pkcs7-mime
p7r Application/x-pkcs7-certreqresp
P7s application/x-pkcs7-signature
PBM Image/x-portable-bitmap
PDF Application/pdf
PFX APPLICATION/X-PKCS12
PGM Image/x-portable-graymap
Pko Application/ynd.ms-pkipko
PMA Application/x-perfmon
PMC Application/x-perfmon
PML Application/x-perfmon
PMR Application/x-perfmon
PMW Application/x-perfmon
PNG image/x-png
PNM Image/x-portable-anymap
Pot, Application/vnd.ms-powerpoint
PPM Image/x-portable-pixmap
PPS Application/vnd.ms-powerpoint
PPT Application/vnd.ms-powerpoint
PRF Application/pics-rules
PS Application/postscript
Pub Application/x-mspublisher
QT Video/quicktime
RA Audio/x-pn-realaudio
Ram Audio/x-pn-realaudio
RAS Image/x-cmu-raster
RGB Image/x-rgb
RMI Audio/mid
Roff Application/x-troff
RTF Application/rtf
RTX Text/richtext
SCD Application/x-msschedule
SCT Text/scriptlet
Setpay application/set-payment-initiation
SetReg Application/set-registration-initiation
SH application/x-sh
Shar Application/x-shar
Sit application/x-stuffit
SND Audio/basic
SPC Application/x-pkcs7-certificates
SPL Application/futuresplash
SRC Application/x-wais-source
SST Application/vnd.ms-pkicertstore
STL Application/vnd.ms-pkistl
STM text/html
Sv4cpio Application/x-sv4cpio
SV4CRC APPLICATION/X-SV4CRC
T Application/x-troff
Tar Application/x-tar
Tcl APPLICATION/X-TCL
Tex Application/x-tex
Texi Application/x-texinfo
Texinfo Application/x-texinfo
Tgz application/x-compressed
TIF Image/tiff
TIFF Image/tiff
TR Application/x-troff
TRM Application/x-msterminal
TSV Text/tab-separated-values
TXT Text/plain
ULS text/iuls
Ustar Application/x-ustar
VCF Text/x-vcard
VRML X-WORLD/X-VRML
WAV Audio/x-wav
WCM Application/vnd.ms-works
WDB Application/vnd.ms-works
Wks Application/vnd.ms-works
WMF Application/x-msmetafile
WPS Application/vnd.ms-works
WRI Application/x-mswrite
WRL X-WORLD/X-VRML
Wrz X-WORLD/X-VRML
Xaf X-WORLD/X-VRML
XBM Image/x-xbitmap
XLA application/vnd.ms-excel
XLC Application/vnd.ms-excel
XLM application/vnd.ms-excel
XLS application/vnd.ms-excel
XLT Application/vnd.ms-excel
XLW Application/vnd.ms-excel
Xof X-WORLD/X-VRML
XPM Image/x-xpixmap
XWD Image/x-xwindowdump
Z application/x-compress
Zip Application/zip-firefox
Application/x-zip-compressed-ie
PHP Upload Compressed file (rar,7z,zip)
PHP upload executable file (EXE)
PHP uploads video files, music files, lyrics files (AVI,RMVB,3GP,FLV,MP3,WAV,KRC,LRC)
PHP uploads text files and document files (Word->doc,excel->xls, slide->ppt,pdf,chm)
PHP Upload database files (access files, SQL files, con files, log files log, dat files)
PHP upload Web files, script files, font files (ini,php,html,htm, font files: Ttf,fon, JS, XML)
PHP Uploads other files (class file, DLL dynamic load library file)

The above describes the file Transfer tool php file upload suffix name and file type table almost covers all files, including the file transfer tool aspects, I hope to be interested in PHP tutorial friends helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.