The following code demonstrates the unrestricted upload of a file with a Java servlet and a path traversal vulnerability. The action attribute of an HTML form is sending the upload file request to the Java servlet.
(good code)
<form action="FileUploadServlet" method="post" enctype="multipart/form-data">
Choose a file to upload: