Add fileupload to ujax post servlet
-----------------------------------

                 Key: SLING-168
                 URL: https://issues.apache.org/jira/browse/SLING-168
             Project: Sling
          Issue Type: Improvement
          Components: microsling
            Reporter: Tobias Bocanegra


currently uploaded files are handled like 'normal' fields and their
value is read via the MultipartPostParameter's getString(). the result
is that the properties get the string content of the uploaded files. i
think this is not what people want.

i suggest to implement a default behaviour that creates an 'nt:file'
subnode for that uploaded file if the parent node is a nt:folder, or create a 
nt:resource otherwise.

<form action="/home/tripod/profile" method="post" enctype="multipart/form-data">
 <input type="file" name="./portrait" />
</form>

results in :

+ home
 + tripod [nt:folder]
   + portrait  [nt:file]
     + jcr:content [nt:resource]
       - jcr:data (data of uploaded file)

or:

+ home
 + tripod [nt:unstructured]
   + portrait  [nt:resource]
       - jcr:data (data of uploaded file)

if the name is not specified, i.e. has an /* suffix, the name of the uploaded 
file is used for node creation.
if the file is not uploaded at all, the node is not deleted.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to