Search code examples
wicket-1.5

File interceptor in Wicket?


Do we have any functionality available in Apache Wicket for file uploads, where i can have different properties like file object,content Type,file name readily available.


Solution

  • Just use a FileUploadField, mark the form as multiplePart and when the form is submitted you can access the FileUpload which has properties getSize(), getContentType() and getClientFileName().

    More info & example: http://wicket.apache.org/apidocs/1.5/org/apache/wicket/markup/html/form/upload/FileUpload.html

    http://www.mkyong.com/wicket/wicket-file-upload-example/