Child pages
  • File Upload Interceptor

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Note

See this page for more examples and advanced configuration

Wiki Markup
{snippet:id=description|javadoc=true|url=org.apache.struts2.interceptor.FileUploadInterceptor}

Parameters

Wiki Markup
{snippet:id=parameters|javadoc=true|url=org.apache.struts2.interceptor.FileUploadInterceptor}

Extending the Interceptor

Wiki Markup
{snippet:id=extending|javadoc=true|url=org.apache.struts2.interceptor.FileUploadInterceptor}

Examples

Example action mapping:

Wiki Markup
{snippet:id=example-configuration|lang=xml|javadoc=true|url=org.apache.struts2.interceptor.FileUploadInterceptor}

Notice the interceptor configuration in the preceding example.

Example JSP form tags:

Wiki Markup
{snippet:id=example-form|lang=xml|javadoc=true|url=org.apache.struts2.interceptor.FileUploadInterceptor}
Wiki Markup
{snippet:id=multipart-note|javadoc=true|url=org.apache.struts2.interceptor.FileUploadInterceptor}

Example Action class:

Wiki Markup
{snippet:id=example-action|lang=java|javadoc=true|url=org.apache.struts2.interceptor.FileUploadInterceptor}

Setting parameters example:

Code Block
xml
xml
<interceptor-ref name="fileUpload">
  <param name="allowedTypes">
     image/png,image/gif,image/jpeg
  </param>
</interceptor-ref>

This part is optional and would be done in place of the <interceptor-ref name="fileUpload"/> line in the action mapping example above.