JAX-RS (REST)No Comments

In this tutorial, we show you how do to file upload with Jersey, JAX-RS implementation.

  • Jersey Multipart Dependency

To support multipart (file upload) in Jersey, you just need to include “jersey-multipart.jar” in Maven pom.xml file.

  • File Upload HTML Form

Simple HTML form to select and upload a file.

  • Upload Service with Jersey

In Jersey, use @FormDataParam to receive the uploaded file. To get the uploaded file name or header detail, match it to “FormDataContentDisposition“.

4. Demo

Select a file and click on the upload button, the selected file is uploaded to a pre-defined location.

URL : http://localhost:8080/RESTfulExample/FileUpload.html


Be the first to post a comment.

Add a comment