[ 
https://issues.apache.org/jira/browse/SLING-2707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13757379#comment-13757379
 ] 

Alexander Klimetschek commented on SLING-2707:
----------------------------------------------

Feedback:
- are the node types required in the jcr/resource bundle, in a cnd which 
otherwise only defines the sling:Resource node type?
- IMO the :applyToChunks flag is not necessary, if you want to abort, you 
simple DELETE (or :operation=delete) the target file
- also, we cannot rely that this is always sent correctly by the client, the 
usual "abort" case will be that the upload has been aborted and nothing else is 
happening anymore. We need to handle partially uploaded nt:file nodes in some 
way then... garbage collection?
- the validation in SlingFileUploadHandler lines 271 ff. seems very strict to 
me:
-- only sequential chunk upload allowed (chunkOffset != currentLength)
-- the totalLength != expectedLength check in line 286 seems wrong to me; IIUC, 
this would fail if the current chunk's length (totalLength) is not matching the 
total file length (expectedLength, stored as sling:fileLength), which defeats 
the purpose of multiple chunks (although I wonder how the tests run, there must 
be an oversight)
- What else is the need for the sling:length property then? IMO it's not 
needed, too easy to get out of sync with what's in the sling:chunk child nodes 
anyway
- Is this thread-safe? Assuming multiple chunk requests coming in in parallel.
- Merging is done through a temporary file stored on the file system, using a 
custom defined memory buffer of 16KB. I think this can be done simpler using a 
[SequenceInputStream|http://stackoverflow.com/questions/14295099/how-to-chain-multiple-different-inputstreams-into-one-inputstream]
 just piping them all together. (And don't do things like {{new 
byte[16*1024]}}, use commons-io when needed).
- the RequestProperty extensions (getOffset, getLength, etc.) might be useful 
to separate out into a Chunk object that you get via RequestProperty.getChunk() 
(null if not a chunk), to avoid polluting that object with methods that only 
make sense in a certain scenario together
                
> Support of chunked file upload into Sling
> -----------------------------------------
>
>                 Key: SLING-2707
>                 URL: https://issues.apache.org/jira/browse/SLING-2707
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>            Reporter: Shashank Gupta
>            Assignee: Carsten Ziegeler
>             Fix For: Servlets Post 2.3.4
>
>         Attachments: SLING-2707.patch, SLING-2707-svn.patch, uploadclient.jar
>
>
> Use cases: 
> 1. Large file upload - With high speed internet connections, advent of cloud 
> and HD going mainstream, Sling should support large files (> 2GB) upload.
> 2. Fault tolerant uploads - Sling should provide capability to resume upload 
> from failure point. It should not require client to restart the complete 
> upload process. 
> 3. Faster upload: Sling should support its clients to initiate multiple 
> connection and upload file chunks in parallel. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to