You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2008/01/16 14:14:35 UTC

[jira] Created: (SLING-168) Add fileupload to ujax post servlet

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.


[jira] Updated: (SLING-168) Add fileupload to ujax post servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra updated SLING-168:
-----------------------------------

    Attachment: fileupload-r612570.patch

implemented ujax file upload and added some simple tests.


> 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
>         Attachments: fileupload-r612570.patch
>
>
> 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.


[jira] Resolved: (SLING-168) Add fileupload to ujax post servlet

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz resolved SLING-168.
---------------------------------------

    Resolution: Fixed

Committed with minor changes in revision 612842 - file to upload was missing in patch + added some comments and TODO notes.

Thanks for your contribution - it's sooooooo easy when people provide tests with their patches!

> 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
>            Assignee: Bertrand Delacretaz
>         Attachments: fileupload-r612570.patch
>
>
> 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.


[jira] Assigned: (SLING-168) Add fileupload to ujax post servlet

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz reassigned SLING-168:
-----------------------------------------

    Assignee: Bertrand Delacretaz

> 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
>            Assignee: Bertrand Delacretaz
>         Attachments: fileupload-r612570.patch
>
>
> 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.


[jira] Closed: (SLING-168) Add fileupload to ujax post servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra closed SLING-168.
----------------------------------


> 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
>            Assignee: Bertrand Delacretaz
>         Attachments: fileupload-r612570.patch
>
>
> 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.