CXF REST Upload Client Example explains about step by step details of uploading a file / attachment using CXF Restful Service with Spring and Eclipse
JAX-RS uses annotations for simplifying the development efforts.
You can see the below example, which is demonstrating How to upload file / attachment using Apache CXF REST
CXF REST Upload Client
Just deploy below test.jsp
<html> <body> <h1>JAX-RS Upload Form</h1> <form action="http://localhost:8080/CXFRestUpload/services/rest/uploadFile" method="post" enctype="multipart/form-data"> <p> Select a file : <input type="file" name="uploadedFile" size="50" /> </p> <input type="submit" value="Upload It" /> </form> </body> </html>