into chunks; • Upload chunks to a web server; • Web server combine the chunks together into a complete file. • Client adds custom HTTP Header: X-Content- Range for the position of current chunk • Server response with uploaded range. Monday, 24 October, 11
session data in localstorage? • Yes => send a 100 byte chunk to server, and update ChunkManager with the byte-range return from server • (A) ask Chunk Manager the byte range to send (simply an array of ranges sent) • chunk the data with webkitSlice() • post the data with XHR • xhr.onReadyStateChange: • if chunk complete => update localStorage and ChunkManager with new chunk positions, go back to (A) • else => show error. • When PauseFile is clicked: • Interrupt the current XHR Monday, 24 October, 11
each chunks into the directory, and combine chunks when a chunk is complete. • Remove tmp file when 404, 400, .... is returned for proxy. • So if it is 200, the other side of the proxy need to remove the file. • Return 201 if file is in-complete, with range data like “0-100, 105-200” in Body • Return 200 if a file is completed. Monday, 24 October, 11