- 浏览: 40757 次
- 性别:
- 来自: 珠海
最近访客 更多访客>>
文章分类
最新评论
-
sonicluo3:
哈哈,关于 aoi_sola 感谢信可以看 这里
哈哈,最近在玩新浪微博,感觉挺有趣的 -
爱死不活:
<p>aoi_sola 感谢在推特上(twitte ...
哈哈,最近在玩新浪微博,感觉挺有趣的 -
Feiing:
<div class="quote_title ...
哈哈,最近在玩新浪微博,感觉挺有趣的 -
zhouxwyeah:
呵呵,这哥们死盯着2选一了~~
哈哈,最近在玩新浪微博,感觉挺有趣的 -
climber2002:
moderating 写道庄表伟 写道新浪有凤姐,twitte ...
哈哈,最近在玩新浪微博,感觉挺有趣的
下面是使用struts2文件上传框架时候支持的 ContentType 的类型,看来支持得还是蛮全面的.
Description of Data Content Typical Filename Extensions
MIME type/subtype 文本类型
Text and Text-Related Types
HTML text data (RFC 1866) html htm text/html
Plain text: documents; program listings txt c c++ pl cc h text/plain
Richtext (obsolete - replaced by text/enriched) text/richtext
Structure enhanced text (etx?) text/x-setext
Enriched text markup (RFC 1896) text/enriched
Tab-separated values (tabular) (tsv?) text/tab-separated-values
SGML documents (RFC 1874) text/sgml
Speech synthesis data (MVP Solutions) talk text/x-speech
Document Stylesheet Types
Cascading Stylesheets css text/css
DSSSL-online stylesheets application/dsssl (proposed)
Image Types 图像类型
GIF gif image/gif
X-Windows bitmap (b/w) xbm image/x-xbitmap
X-Windows pixelmap (8-bit color) xpm image/x-xpixmap
Portable Network Graphics png image/x-png
Image Exchange Format (RFC 1314) ief image/ief
JPEG jpeg jpg jpe image/jpeg
TIFF tiff tif image/tiff
RGB rgb image/rgb image/x-rgb
Group III Fax (RFC 1494) g3f image/g3fax
X Windowdump format xwd image/x-xwindowdump
Macintosh PICT format pict image/x-pict
PPM (UNIX PPM package) ppm image/x-portable-pixmap
PGM (UNIX PPM package) pgm image/x-portable-graymap
PBM (UNIX PPM package) pbm image/x-portable-bitmap
PNM (UNIX PPM package) pnm image/x-portable-anymap
Microsoft Windows bitmap bmp image/x-ms-bmp
CMU raster ras image/x-cmu-raster
Kodak Photo-CD pcd image/x-photo-cd
Computer Graphics Metafile cgm image/cgm
North Am. Presentation Layer Protocol image/naplps
CALS Type 1 or 2 mil cal image/x-cals
Fractal Image Format (Iterated Systems) fif image/fif
QuickSilver active image (Micrografx) dsf image/x-mgx-dsf
CMX vector image (Corel) cmx image/x-cmx
Wavelet-compressed (Summus) wi image/wavelet
AutoCad Drawing (SoftSource) dwg image/vnd.dwg
image/x-dwg
AutoCad DXF file (SoftSource) dxf image/vnd.dxf
image/x-dxf
Simple Vector Format (SoftSource) svf image/vnd.svf
also vector/x-svf
Audio/Voice/Music Related Types 声音和视频类型
"basic"audio - 8-bit u-law PCM au snd audio/basic
Macintosh audio format (AIpple) aif aiff aifc audio/x-aiff
Microsoft audio wav audio/x-wav
MPEG audio mpa abs mpega audio/x-mpeg
MPEG-2 audio mp2a mpa2 audio/x-mpeg-2
compressed speech (Echo Speech Corp.) es audio/echospeech
Toolvox speech audio (Voxware) vox audio/voxware
RapidTransit compressed audio (Fast Man) lcc application/fastman
Realaudio (Progressive Networks) ra ram application/x-pn-realaudio
NIFF music notation data format application/vnd.music-niff
MIDI music data mmid x-music/x-midi
Koan music data (SSeyo) skp application/vnd.koan
application/x-koan
Speech synthesis data (MVP Solutions) talk text/x-speech
Video Types
MPEG video mpeg mpg mpe video/mpeg
MPEG-2 video mpv2 mp2v video/mpeg-2
Macintosh Quicktime qt mov video/quicktime
Microsoft video avi video/x-msvideo
SGI Movie format movie video/x-sgi-movie
VDOlive streaming video (VDOnet) vdo video/vdo
Vivo streaming video (Vivo software) viv video/vnd.vivo video/vivo
Special HTTP/Web Application Types
Proxy autoconfiguration (Netscape browsers) pac application/x-ns-proxy-autoconfig
See Chapter 6 application/x-www-form-urlencoded
See Chapter 9 application/x-www-local-exec
See Chapter 9 (Netscape extension) multipart/x-mixed-replace
See Chapter 9 and Appendix B multipart/form-data
Netscape Cooltalk chat data (Netscape) ice x-conference/x-cooltalk
Interactive chat (Ichat) application/x-chat
Application Types 应用程序类型
Text-Related
PostScript ai eps ps application/postscript
Microsoft Rich Text Format rtf application/rtf
Adobe Acrobat PDF pdf application/pdf
application/x-pdf
Maker Interchange Format (FrameMaker) mif application/vnd.mif
application/x-mif
Troff document t tr roff application/x-troff
Troff document with MAN macros man application/x-troff-man
Troff document with ME macros me application/x-troff-me
Troff document with MS macros ms application/x-troff-ms
LaTeX document latex application/x-latex
Tex/LateX document tex application/x-tex
GNU TexInfo document texinfo texi application/x-texinfo
TeX dvi format dvi application/x-dvi
MacWrite document ?? application/macwriteii
MS word document ?? application/msword
WordPerfect 5.1 document ?? application/wordperfect5.1
SGML application (RFC 1874) application/sgml
Office Document Architecture oda application/oda
Envoy Document evy application/envoy
Wang Info. Tranfer Format (Wang) application/wita
DEC Document Transfer Format (DEC) application/dec-dx
IBM Document Content Architecture (IBM) application/dca-rft
CommonGround Digital Paper (No Hands Software) application/commonground
FrameMaker Documents (Frame) doc fm frm frame application/vnd.framemaker
application/x-framemaker
Remote printing at arbitrary printers (RFC 1486) application/remote-printing
Archive/Compressed Archives 档案类型
Gnu tar format gtar application/x-gtar
4.3BSD tar format tar application/x-tar
POSIX tar format ustar application/x-ustar
Old CPIO format bcpio application/x-bcpio
POSIX CPIO format cpio application/x-cpio
UNIX sh shell archive shar application/x-shar
DOS/PC - Pkzipped archive zip application/zip
Macintosh Binhexed archive hqx application/mac-binhex40
Macintosh Stuffit Archive sit sea application/x-stuffit
Fractal Image Format fif application/fractals
Binary, UUencoded bin uu application/octet-stream
PC executable exe application/octet-stream
WAIS "sources" src wsrc application/x-wais-source
NCSA HDF data format hdf application/hdf
Downloadable Program/Scripts 编程语言代码/脚本
Javascript program js ls mocha text/javascript
application/x-javascript
VBScript program text/vbscript
UNIX bourne shell program sh application/x-sh
UNIX c-shell program csh application/x-csh
Perl program pl application/x-perl
Tcl (Tool Control Language) program tcl application/x-tcl
Atomicmail program scripts (obsolete) application/atomicmail
Slate documents - executable enclosures (BBN) application/slate
Undefined binary data (often executable progs) application/octet-stream
RISC OS Executable programs (ANT Limited) application/riscos
Animation/Multimedia
Andrew Toolkit inset application/andrew-inset
FutureSplash vector animation (FutureWave) spl application/futuresplash
mBED multimedia data (mBED) mbd application/mbedlet
Macromedia Shockwave (Macromedia) application/x-director
Sizzler real-time video/animation application/x-sprite
PowerMedia multimedia (RadMedia) rad application/x-rad-powermedia
Presentation
PowerPoint presentation (Microsoft) ppz application/mspowerpoint
PointPlus presentation data (Net Scene) css application/x-pointplus
ASAP WordPower (Software Publishing Corp.) asp application/x-asap
Astound Web Player multimedia data (GoldDisk) asn application/astound
Special Embedded Object
OLE script e.g. Visual Basic (Ncompass) axs application/x-olescript
OLE Object (Microsoft/NCompass) ods application/x-oleobject
OpenScape OLE/OCX objects (Business@Web) opp x-form/x-openscape
Visual Basic objects (Amara) wba application/x-webbasic
Specialized data entry forms (Alpha Software) frm application/x-alpha-form
client-server objects (Wayfarer Communications) wfx x-script/x-wfxclient
General Applications
Undefined binary data (often executable progs) application/octet-stream
CALS (U.S. D.O.D data format - RFC 1895) application/cals-1840
Pointcast news data (Pointcast) pcn application/x-pcn
Excel spreadsheet (Microsoft) application/vnd.ms-excel
application/x-msexcel
application/ms-excel
PowerPoint (Microsoft) ppt application/vnd.ms-powerpoint
application/ms-powerpoint
Microsoft Project (Microsoft) application/vnd.ms-project
Works data (Microsoft) application/vnd.ms-works
MAPI data (Microsoft) application/vnd.ms-tnef
Artgallery data (Microsoft) application/vnd.artgalry
SourceView document (Dataware Electronics) svd application/vnd.svd
Truedoc (Bitstream) application/vnd.truedoc
Net Install - software install (20/20 Software) ins application/x-net-install
Carbon Copy - remote control/access (Microcom) ccv application/ccv
Spreadsheets (Visual Components) vts workbook/formulaone
Cybercash digital money (Cybercash) application/cybercash
Format for sending generic Macintosh files application/applefile
Active message -- connect to active mail app. application/activemessage
X.400 mail message body part (RFC 1494) application/x400-bp
USENET news message id (RFC 1036) application/news-message-id
USENET news message (RFC 1036) application/news-transmission
Multipart Types (mostly email)
Messages with multiple parts multipart/mixed
Messages with multiple, alternative parts multipart/alternative
Message with multiple, related parts multipart/related
Multiple parts are digests multipart/digest
For reporting of email status (admin.) multipart/report
Order of parts does not matter multipart/parallel
Macintosh file data multipart/appledouble
Aggregate messages; descriptor as header multipart/header-set
Container for voice-mail multipart/voice-message
HTML FORM data (see Ch. 9 and App. B) multipart/form-data
Infinite multiparts - See Chapter 9 (Netscape) multipart/x-mixed-replace
Message Types (mostly email)
MIME message message/rfc822
Partial message message/partial
Message containing external references message/external-body
Message containing USENET news message/news
HTTP message message/http
2D/3D Data/Virtual Reality Types
VRML data file wrl vrml x-world/x-vrml
(changing to model/vrml)
WIRL - VRML data (VREAM) vrw x-world/x-vream
Play3D 3d scene data (Play3D) p3d application/x-p3d
Viscape Interactive 3d world data (Superscape) svr x-world/x-svr
WebActive 3d data (Plastic Thought) wvr x-world/x-wvr
QuickDraw3D scene data (Apple) 3dmf x-world/x-3dmf
Scientific/Math/CAD Types
Chemical types -- to communicate information about chemical models chemical/* (several subtypes)
Mathematica notebook ma application/mathematica
Computational meshes for numerical simulations msh x-model/x-mesh
(evolving to model/mesh)
Vis5D 5-dimensional data v5d application/vis5d
IGES models -- CAD/CAM (CGM) data igs application/iges
(evolving to model/iges?)
Autocad WHIP vector drawings dwf drawing/x-dwf
Largely Platform-Specific Types
Silicon Graphics Specific Types
Showcase Presentations showcase slides sc sho show application/x-showcase
Insight Manual pages ins insight application/x-insight
Iris Annotator data ano application/x-annotator
Directory Viewer dir application/x-dirview
Software License lic application/x-enterlicense
Fax manager file faxmgr application/x-fax-manager
Fax job data file faxmgrjob application/x-fax-manager-job
IconBook data icnbk application/x-iconbook
? wb application/x-inpview
Installable software in 'inst' format inst application/x-install
Mail folder mail application/x-mailfolder
? pp ppages application/x-ppages
Data for printer (via lpr) sgi-lpr application/x-sgi-lpr
Software in 'tardist' format tardist application/x-tardist
Software in compressed 'tardist' format ztardist application/x-ztardist
WingZ spreadsheet wkz application/x-wingz
Open Inventor 3-D scenes iv graphics/x-inventor
Description of Data Content Typical Filename Extensions
MIME type/subtype 文本类型
Text and Text-Related Types
HTML text data (RFC 1866) html htm text/html
Plain text: documents; program listings txt c c++ pl cc h text/plain
Richtext (obsolete - replaced by text/enriched) text/richtext
Structure enhanced text (etx?) text/x-setext
Enriched text markup (RFC 1896) text/enriched
Tab-separated values (tabular) (tsv?) text/tab-separated-values
SGML documents (RFC 1874) text/sgml
Speech synthesis data (MVP Solutions) talk text/x-speech
Document Stylesheet Types
Cascading Stylesheets css text/css
DSSSL-online stylesheets application/dsssl (proposed)
Image Types 图像类型
GIF gif image/gif
X-Windows bitmap (b/w) xbm image/x-xbitmap
X-Windows pixelmap (8-bit color) xpm image/x-xpixmap
Portable Network Graphics png image/x-png
Image Exchange Format (RFC 1314) ief image/ief
JPEG jpeg jpg jpe image/jpeg
TIFF tiff tif image/tiff
RGB rgb image/rgb image/x-rgb
Group III Fax (RFC 1494) g3f image/g3fax
X Windowdump format xwd image/x-xwindowdump
Macintosh PICT format pict image/x-pict
PPM (UNIX PPM package) ppm image/x-portable-pixmap
PGM (UNIX PPM package) pgm image/x-portable-graymap
PBM (UNIX PPM package) pbm image/x-portable-bitmap
PNM (UNIX PPM package) pnm image/x-portable-anymap
Microsoft Windows bitmap bmp image/x-ms-bmp
CMU raster ras image/x-cmu-raster
Kodak Photo-CD pcd image/x-photo-cd
Computer Graphics Metafile cgm image/cgm
North Am. Presentation Layer Protocol image/naplps
CALS Type 1 or 2 mil cal image/x-cals
Fractal Image Format (Iterated Systems) fif image/fif
QuickSilver active image (Micrografx) dsf image/x-mgx-dsf
CMX vector image (Corel) cmx image/x-cmx
Wavelet-compressed (Summus) wi image/wavelet
AutoCad Drawing (SoftSource) dwg image/vnd.dwg
image/x-dwg
AutoCad DXF file (SoftSource) dxf image/vnd.dxf
image/x-dxf
Simple Vector Format (SoftSource) svf image/vnd.svf
also vector/x-svf
Audio/Voice/Music Related Types 声音和视频类型
"basic"audio - 8-bit u-law PCM au snd audio/basic
Macintosh audio format (AIpple) aif aiff aifc audio/x-aiff
Microsoft audio wav audio/x-wav
MPEG audio mpa abs mpega audio/x-mpeg
MPEG-2 audio mp2a mpa2 audio/x-mpeg-2
compressed speech (Echo Speech Corp.) es audio/echospeech
Toolvox speech audio (Voxware) vox audio/voxware
RapidTransit compressed audio (Fast Man) lcc application/fastman
Realaudio (Progressive Networks) ra ram application/x-pn-realaudio
NIFF music notation data format application/vnd.music-niff
MIDI music data mmid x-music/x-midi
Koan music data (SSeyo) skp application/vnd.koan
application/x-koan
Speech synthesis data (MVP Solutions) talk text/x-speech
Video Types
MPEG video mpeg mpg mpe video/mpeg
MPEG-2 video mpv2 mp2v video/mpeg-2
Macintosh Quicktime qt mov video/quicktime
Microsoft video avi video/x-msvideo
SGI Movie format movie video/x-sgi-movie
VDOlive streaming video (VDOnet) vdo video/vdo
Vivo streaming video (Vivo software) viv video/vnd.vivo video/vivo
Special HTTP/Web Application Types
Proxy autoconfiguration (Netscape browsers) pac application/x-ns-proxy-autoconfig
See Chapter 6 application/x-www-form-urlencoded
See Chapter 9 application/x-www-local-exec
See Chapter 9 (Netscape extension) multipart/x-mixed-replace
See Chapter 9 and Appendix B multipart/form-data
Netscape Cooltalk chat data (Netscape) ice x-conference/x-cooltalk
Interactive chat (Ichat) application/x-chat
Application Types 应用程序类型
Text-Related
PostScript ai eps ps application/postscript
Microsoft Rich Text Format rtf application/rtf
Adobe Acrobat PDF pdf application/pdf
application/x-pdf
Maker Interchange Format (FrameMaker) mif application/vnd.mif
application/x-mif
Troff document t tr roff application/x-troff
Troff document with MAN macros man application/x-troff-man
Troff document with ME macros me application/x-troff-me
Troff document with MS macros ms application/x-troff-ms
LaTeX document latex application/x-latex
Tex/LateX document tex application/x-tex
GNU TexInfo document texinfo texi application/x-texinfo
TeX dvi format dvi application/x-dvi
MacWrite document ?? application/macwriteii
MS word document ?? application/msword
WordPerfect 5.1 document ?? application/wordperfect5.1
SGML application (RFC 1874) application/sgml
Office Document Architecture oda application/oda
Envoy Document evy application/envoy
Wang Info. Tranfer Format (Wang) application/wita
DEC Document Transfer Format (DEC) application/dec-dx
IBM Document Content Architecture (IBM) application/dca-rft
CommonGround Digital Paper (No Hands Software) application/commonground
FrameMaker Documents (Frame) doc fm frm frame application/vnd.framemaker
application/x-framemaker
Remote printing at arbitrary printers (RFC 1486) application/remote-printing
Archive/Compressed Archives 档案类型
Gnu tar format gtar application/x-gtar
4.3BSD tar format tar application/x-tar
POSIX tar format ustar application/x-ustar
Old CPIO format bcpio application/x-bcpio
POSIX CPIO format cpio application/x-cpio
UNIX sh shell archive shar application/x-shar
DOS/PC - Pkzipped archive zip application/zip
Macintosh Binhexed archive hqx application/mac-binhex40
Macintosh Stuffit Archive sit sea application/x-stuffit
Fractal Image Format fif application/fractals
Binary, UUencoded bin uu application/octet-stream
PC executable exe application/octet-stream
WAIS "sources" src wsrc application/x-wais-source
NCSA HDF data format hdf application/hdf
Downloadable Program/Scripts 编程语言代码/脚本
Javascript program js ls mocha text/javascript
application/x-javascript
VBScript program text/vbscript
UNIX bourne shell program sh application/x-sh
UNIX c-shell program csh application/x-csh
Perl program pl application/x-perl
Tcl (Tool Control Language) program tcl application/x-tcl
Atomicmail program scripts (obsolete) application/atomicmail
Slate documents - executable enclosures (BBN) application/slate
Undefined binary data (often executable progs) application/octet-stream
RISC OS Executable programs (ANT Limited) application/riscos
Animation/Multimedia
Andrew Toolkit inset application/andrew-inset
FutureSplash vector animation (FutureWave) spl application/futuresplash
mBED multimedia data (mBED) mbd application/mbedlet
Macromedia Shockwave (Macromedia) application/x-director
Sizzler real-time video/animation application/x-sprite
PowerMedia multimedia (RadMedia) rad application/x-rad-powermedia
Presentation
PowerPoint presentation (Microsoft) ppz application/mspowerpoint
PointPlus presentation data (Net Scene) css application/x-pointplus
ASAP WordPower (Software Publishing Corp.) asp application/x-asap
Astound Web Player multimedia data (GoldDisk) asn application/astound
Special Embedded Object
OLE script e.g. Visual Basic (Ncompass) axs application/x-olescript
OLE Object (Microsoft/NCompass) ods application/x-oleobject
OpenScape OLE/OCX objects (Business@Web) opp x-form/x-openscape
Visual Basic objects (Amara) wba application/x-webbasic
Specialized data entry forms (Alpha Software) frm application/x-alpha-form
client-server objects (Wayfarer Communications) wfx x-script/x-wfxclient
General Applications
Undefined binary data (often executable progs) application/octet-stream
CALS (U.S. D.O.D data format - RFC 1895) application/cals-1840
Pointcast news data (Pointcast) pcn application/x-pcn
Excel spreadsheet (Microsoft) application/vnd.ms-excel
application/x-msexcel
application/ms-excel
PowerPoint (Microsoft) ppt application/vnd.ms-powerpoint
application/ms-powerpoint
Microsoft Project (Microsoft) application/vnd.ms-project
Works data (Microsoft) application/vnd.ms-works
MAPI data (Microsoft) application/vnd.ms-tnef
Artgallery data (Microsoft) application/vnd.artgalry
SourceView document (Dataware Electronics) svd application/vnd.svd
Truedoc (Bitstream) application/vnd.truedoc
Net Install - software install (20/20 Software) ins application/x-net-install
Carbon Copy - remote control/access (Microcom) ccv application/ccv
Spreadsheets (Visual Components) vts workbook/formulaone
Cybercash digital money (Cybercash) application/cybercash
Format for sending generic Macintosh files application/applefile
Active message -- connect to active mail app. application/activemessage
X.400 mail message body part (RFC 1494) application/x400-bp
USENET news message id (RFC 1036) application/news-message-id
USENET news message (RFC 1036) application/news-transmission
Multipart Types (mostly email)
Messages with multiple parts multipart/mixed
Messages with multiple, alternative parts multipart/alternative
Message with multiple, related parts multipart/related
Multiple parts are digests multipart/digest
For reporting of email status (admin.) multipart/report
Order of parts does not matter multipart/parallel
Macintosh file data multipart/appledouble
Aggregate messages; descriptor as header multipart/header-set
Container for voice-mail multipart/voice-message
HTML FORM data (see Ch. 9 and App. B) multipart/form-data
Infinite multiparts - See Chapter 9 (Netscape) multipart/x-mixed-replace
Message Types (mostly email)
MIME message message/rfc822
Partial message message/partial
Message containing external references message/external-body
Message containing USENET news message/news
HTTP message message/http
2D/3D Data/Virtual Reality Types
VRML data file wrl vrml x-world/x-vrml
(changing to model/vrml)
WIRL - VRML data (VREAM) vrw x-world/x-vream
Play3D 3d scene data (Play3D) p3d application/x-p3d
Viscape Interactive 3d world data (Superscape) svr x-world/x-svr
WebActive 3d data (Plastic Thought) wvr x-world/x-wvr
QuickDraw3D scene data (Apple) 3dmf x-world/x-3dmf
Scientific/Math/CAD Types
Chemical types -- to communicate information about chemical models chemical/* (several subtypes)
Mathematica notebook ma application/mathematica
Computational meshes for numerical simulations msh x-model/x-mesh
(evolving to model/mesh)
Vis5D 5-dimensional data v5d application/vis5d
IGES models -- CAD/CAM (CGM) data igs application/iges
(evolving to model/iges?)
Autocad WHIP vector drawings dwf drawing/x-dwf
Largely Platform-Specific Types
Silicon Graphics Specific Types
Showcase Presentations showcase slides sc sho show application/x-showcase
Insight Manual pages ins insight application/x-insight
Iris Annotator data ano application/x-annotator
Directory Viewer dir application/x-dirview
Software License lic application/x-enterlicense
Fax manager file faxmgr application/x-fax-manager
Fax job data file faxmgrjob application/x-fax-manager-job
IconBook data icnbk application/x-iconbook
? wb application/x-inpview
Installable software in 'inst' format inst application/x-install
Mail folder mail application/x-mailfolder
? pp ppages application/x-ppages
Data for printer (via lpr) sgi-lpr application/x-sgi-lpr
Software in 'tardist' format tardist application/x-tardist
Software in compressed 'tardist' format ztardist application/x-ztardist
WingZ spreadsheet wkz application/x-wingz
Open Inventor 3-D scenes iv graphics/x-inventor
相关推荐
在Struts2中,文件上传和下载是常见的功能需求,特别是在处理用户交互和数据交换时。这篇博客文章提供的"struts2文件上传下载源代码"旨在帮助开发者理解和实现这些功能。 文件上传功能允许用户从他们的设备上传文件...
在`struts.xml`配置文件中,为需要支持文件上传的Action添加`params`和`fileUpload`拦截器,并设置允许的最大上传大小。例如: ```xml <package name="default" namespace="/" extends="struts-default"> ...
Struts2是一个流行的...理解这些库的作用以及如何在Struts2框架中整合它们,是开发支持文件上传的web应用的关键步骤。正确配置和使用这些库,可以让你轻松地处理用户的文件上传请求,增强应用程序的功能和用户体验。
Struts2提供了方便的文件上传支持,使开发者可以轻松地实现这一功能。 在“struts2文件上传例子.rar”这个项目中,开发者已经使用Struts2.0框架实现了一个简单的文件上传功能。MyEclipse 6.6是一个集成开发环境,...
4. **文件解析**:Struts2支持两种方式处理文件上传:原生的Servlet API和Apache Commons FileUpload库。后者更为常用,因为它提供了更丰富的功能,如处理大文件分块上传、内存和磁盘存储策略等。在Action类中,你...
这两个库提供了文件上传的基础功能,使得Struts2能够处理`multipart/form-data`类型的请求,这是文件上传的标准格式。 Struts2本身并不包含一个内置的请求解析器来处理文件上传。相反,它依赖于第三方库,如Jakarta...
为了支持文件上传,我们需要创建一个继承自`org.apache.struts2.dispatcher.multipart.MultiPartRequest`的Action类,或者使用Struts2提供的`org.apache.struts2.views.util.DefaultMultiPartRequest`。这个类可以...
在Struts2中,文件上传功能是一个常见的需求,例如用户可能需要上传图片、文档或其他类型的文件。本教程将深入浅出地讲解如何在Struts2中实现文件上传,并提供一个简单的实例来帮助理解。 1. **Struts2文件上传概述...
Struts2 文件上传是Web开发中的一个重要功能,它允许用户从他们的本地计算机向服务器传输文件。在Struts2框架中,文件上传是通过特定的拦截器实现的,这些拦截器处理了文件上传请求并提供了安全性和大小限制。下面将...
在Struts2中,文件上传和下载是常见的功能需求,对于用户交互和数据交换至关重要。以下是对这些知识点的详细阐述: 1. **文件上传**: 在Struts2中,文件上传主要依赖于`Commons FileUpload`库,它是一个Apache提供...
在这个“struts2文件上传例子(支持大文件)”中,我们将探讨如何利用Struts2框架实现文件上传功能,尤其是处理大文件的能力。 在Web应用中,文件上传是一项常见的需求,例如用户可能需要上传照片、文档或视频等。...
Struts2 文件上传是Web开发中的一个重要功能,它允许用户通过网页上传文件到服务器。Struts2 是一个基于MVC(Model-View-Controller)设计模式的Java Web框架,提供了丰富的特性和强大的控制层功能,使得文件上传...
Struts2框架提供了丰富的插件和配置来支持文件上传,其中包括进度条显示,以提升用户交互体验。以下是对这个话题的详细解释。 1. **Struts2 文件上传基础** - Struts2 使用 `struts2-core` 包中的 `...
Struts2 文件上传时遇到“类型不允许的问题”通常与文件扩展名验证有关,这涉及到Struts2框架的安全配置。在Struts2中,为了防止恶意用户上传不安全的文件(如脚本或可执行文件),系统会设定允许上传的文件类型。当...
首先,你需要在项目的配置文件(如struts.xml)中启用文件上传的支持,并配置相应的拦截器。接着,在Action类中创建一个字段来接收上传的文件,Struts2会自动将文件内容绑定到这个字段上。 例如,你可以创建一个名...
6. **源码分析**: 要深入理解Struts2的文件上传机制,你需要查看Struts2的源码,特别是`org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest`和`org.apache.struts2.components.Form`这两个类。...
2. **添加Struts2插件**:Struts2的文件上传功能依赖于`struts2-convention-plugin`和`struts2-core`等库。在`struts.xml`配置文件中,需要启用Multipart解析器,例如添加`<constant name="struts.multipart.parser...
为了处理不同类型的文件,Struts2支持识别和处理多种文件格式。以下是对Struts2中涉及的文件类型及其MIME类型的详细说明: 1. **应用型文件**: - `.a` 和 `.bin`:这些文件通常作为二进制数据流传输,MIME类型为 ...
Struts2作为一款强大的MVC(Model-View-Controller)框架,提供了丰富的功能支持,包括文件上传。这个示例程序旨在帮助初学者理解如何在Struts2框架下实现文件上传。 首先,我们需要了解Struts2文件上传的核心概念...