Hi,
Here are the salient points wrt resumable upload implementation/integration in
SlingPostServlet[1].
1. Resumeable upload is supported in "modify"operation ( ie. In default
operation) . No new operation introduced for it.
2. Request parameter ":chunkNumber" distinguish between partial and
'single shot upload'. Better than "content range" parameter approach, as it
avoids ambiguity in overlapping ranges like 100-199, 100-299 etc.
3. Request parameter ":lastChunk=true" distinguish between intermediate
and last upload chunk.
4. Chunk Storage:
* In place append: will not work in modify use case. In create,
If chunk size is x, Square(x) space consumed in datastore. [x +2x + 3x+ ...
= O(square(x))
* Chunks saved in JCR. If chunk size is x, 2x space consumed in
datastore. Chunks stored at temp location in
/var/chunks/<uploadid>/<chunkNumber>
5. Chunk upload response:
* First/Intermediate chunks: 200 OK. Response body will *not*
contain list of changes . Location header contain temp location
"/var/chunks/<uploadid>". Client can use it to retrieve upload information and
hole information.
* Last chunk: 201/200 in case of creation/modification. Response
body contains list of changes in json or html format.
6. Chunk upload processing
* First/Intermediate chunks: Only save chunk is saved in jcr.
Ignores all upload semantics (@TypeHint, etc) and request parameter.
* Last chunk: Stiches all chunks. Process all upload semantics
and request parameters and creates jcr node structure.
Regards,
Shashank
[1]
http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-ContentCreationorModification
[1]
http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-ContentCreationorModification
-----Original Message-----
From: Alexander Klimetschek [mailto:[email protected]]
Sent: 22 February 2013 04:07
To: [email protected]
Subject: Re: [POST] Servlet resolution for non existing resource
On 21.02.2013, at 17:34, Shashank Gupta <[email protected]> wrote:
> Wrt to implementation of chunked upload feature SLING-2707[0] and [1], it
> require to hit chunkupload servlet (registered on selector "chunk") for a non
> existing resource. So when I post request as [2], servlet resolves to
> default slingpostservlet[3].
> Is there a way to resolve servlet to chunkuploadservlet?
That's actually another good reason to not use the "chunk" selector here, but
integrate the resumable upload with the sling post servlet right away as
proposed in the issue:
https://issues.apache.org/jira/browse/SLING-2707?focusedCommentId=13580754&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13580754
Cheers,
Alex