Chunked File Upload SupportPage edited by Shashank GuptaChanges (4)
Full ContentChunked File UploadStatus: DRAFT Use Cases:1. Large file upload - With high speed internet connections, advent of cloud and HD going mainstream, Sling support large files (> 2GB) upload. ApproachSling provides an endpoint which accepts file chunks in accordance with a specified protocol. Sling client slices the file in chunks, and upload the chunks in serial manner to server. Each chunk is numbered serially and the last chunk has additional identifier to distinguish from the rest chunks. Sling endpoint upon receiving the last chunk, stitches all chunks into a single file. The file inputstream is passed to inner layers for further processing. In case of upload failures, sling provides support to query the last chunk uploaded till failure point. Client resumes chunk upload from last failure point. Protocol SpecificationUpload of first and intermediate chunksUpload the first/intermediate chunks Request: POST /content/dam/dam-folder/asset.pdf.chunkupload.html/chunk/<chunk_number> HTTP/1.1 Host: localhost:4502 Content-Type: Date: <date> Content-Length: 5242880 First/Intermediate chunkUpload Response Response: HTTP/1.1 200 OK Content-Length: 0 Connection: close Server: localhost:4502 Upload of last chunkClient appends "/last" to upload url to signify that it would be last that needs to be uploaded. The last chunk upload request can optionally be multipart request if client requires to send additional parameters to sling. Upload Last chunk request Request: POST /content/dam/dam-folder/asset.pdf.chunkupload.html/chunk/<chunk_number>/last HTTP/1.1 Host: localhost:4502 Date: <date> Content-type: multipart/form-data, boundary=AaB03x --AaB03x content-disposition: form-data; name="fileSize" 210000000 --AaB03x content-disposition: form-data; name="file"; fileName="asset.pdf" Content-Type: application/pdf Content-Transfer-Encoding: binary $binarydata --AaB03x-- Upload Last chunk Response Response: HTTP/1.1 201/CREATED Content-Length: 0 Content-MD5: <md5 checksum of the merged file> Connection: close Query to retrieve last successful chunk uploadReturns the number of last chunk upload successfully on sling. Get last successful chunk upload request Request GET /content/dam/dam-folder/asset.pdf.chunkupload.html HTTP/1.1 Host: localhost:4502 Date: <date> Content-Length: 0 Get last successful upload chunk response
Response:
HTTP/1.1 200/OK
Connection: close
{
"chunkNumber": 8
}
If no broken/discontinued upload sling returns 500 error Get erroneous last successful upload chunk response Response: HTTP/1.1 404/Not Found Abort chunked uploadAbort chunked upload Request Request DELETE /content/dam/dam-folder/asset.pdf.chunkupload.html HTTP/1.1 Host: localhost:4502 Date: <date> Abort chunked upload response Response HTTP/1.1 200/OK Connection: close
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
- [CONF] Apache Sling > Chunked File Upload Support confluence
