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


Warning: stream_socket_client(): unable to connect to http://browscap.org/version (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /home/javasail/public_html/wp-content/plugins/wp-statistics/vendor/browscap/browscap-php/src/phpbrowscap/Browscap.php on line 1366

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/javasail/public_html/wp-content/plugins/wp-statistics/vendor/browscap/browscap-php/src/phpbrowscap/Browscap.php on line 1004