HTML forms that transmit file data must be configured with the POST method and the "multipart/form-data" action. This data can be received in one of two ways by the JAX-RS resource method that accepts it with the IBM Java API for RESTful Web Services (JAX-RS) implementation.
<form action="http://www.example.com/" method="POST" enctype="multipart/form-data"> <input type="text" name="fileid" /> <br /> <input type="text" name="description" /> <br /> <input type="file" name="thefile" /> <br /> <input type="submit" name="submit" value="submit"/> </form>The IBM JAX-RS implementation allows you to receive the data in parts, so you can process these parts yourself, if needed.
You have received and echoed data from an HTTP POST with multipart/form-data Content-Type, by allowing the IBM JAX-RS implementation split and auto-decode the parts for you, and by receiving the still encoded parts to process yourself.
In this information ... | IBM Redbooks, demos, education, and more(Index) |