Class SlingFileUploadHandler

java.lang.Object
org.apache.sling.servlets.post.impl.helper.SlingFileUploadHandler

public class SlingFileUploadHandler extends Object
Handles file uploads.

Simple example: <form action="/home/admin" method="POST" enctype="multipart/form-data"> <input type="file" name="./portrait" /> </form> this will create a nt:file node below "/home/admin" if the node type of "admin" is (derived from) nt:folder, a nt:resource node otherwise.

Filename example: <form action="/home/admin" method="POST" enctype="multipart/form-data"> <input type="file" name="./*" /> </form> same as above, but uses the filename of the uploaded file as name for the new node.

Type hint example: <form action="/home/admin" method="POST" enctype="multipart/form-data"> <input type="file" name="./portrait" /> <input type="hidden" name="./portrait@TypeHint" value="my:file" /> </form> this will create a new node with the type my:file below admin. if the hinted type extends from nt:file an intermediate file node is created otherwise directly a resource node.