client/js/upload-handler/upload.handler.controller.js
function(id) {
            var size = options.getSize(id),
                name = options.getName(id);

            log("All chunks have been uploaded for " + id + " - finalizing....");
            handler.finalizeChunks(id).then(
                function(response, xhr) {
                    log("Finalize successful for " + id);

                    var normaizedResponse = upload.normalizeResponse(response, true);

                    options.onProgress(id, name, size, size);
                    handler._maybeDeletePersistedChunkData(id);
                    upload.cleanup(id, normaizedResponse, xhr);
                },
                function(response, xhr) {
                    var normalizedResponse = upload.normalizeResponse(response, false);

                    log("Problem finalizing chunks for file ID " + id + " - " + normalizedResponse.error, "error");

                    if (
                        normalizedResponse.reset ||
                        (xhr && options.chunking.success.resetOnStatus.indexOf(xhr.status) >= 0)
                    ) {
                        chunked.reset(id);
                    }

                    if (!options.onAutoRetry(id, name, normalizedResponse, xhr)) {
                        upload.cleanup(id, normalizedResponse, xhr);
                    }
                }
            );
        }
function(id) {
            var size = options.getSize(id),
                name = options.getName(id);

            log("All chunks have been uploaded for " + id + " - finalizing....");
            handler.finalizeChunks(id).then(
                function(response, xhr) {
                    log("Finalize successful for " + id);

                    var normaizedResponse = upload.normalizeResponse(response, true);

                    options.onProgress(id, name, size, size);
                    handler._maybeDeletePersistedChunkData(id);
                    upload.cleanup(id, normaizedResponse, xhr);
                },
                function(response, xhr) {
                    var normalizedResponse = upload.normalizeResponse(response, false);

                    log("Problem finalizing chunks for file ID " + id + " - " + normalizedResponse.error, "error");

                    if (
                        normalizedResponse.reset ||
                        (xhr && options.chunking.success.resetOnStatus.indexOf(xhr.status) >= 0)
                    ) {
                        chunked.reset(id);
                    }

                    if (!options.onAutoRetry(id, name, normalizedResponse, xhr)) {
                        upload.cleanup(id, normalizedResponse, xhr);
                    }
                }
            );
        }
function ( id ) { var size = options . getSize ( id ) , name = options . getName ( id ) ; log ( "All chunks have been uploaded for " + id + " - finalizing...." ) ; handler . finalizeChunks ( id ) . then ( function ( response , xhr ) { log ( "Finalize successful for " + id ) ; var normaizedResponse = upload . normalizeResponse ( response , true ) ; options . onProgress ( id , name , size , size ) ; handler . _maybeDeletePersistedChunkData ( id ) ; upload . cleanup ( id , normaizedResponse , xhr ) ; } , function ( response , xhr ) { var normalizedResponse = upload . normalizeResponse ( response , false ) ; log ( "Problem finalizing chunks for file ID " + id + " - " + normalizedResponse . error , "error" ) ; if ( normalizedResponse . reset || ( xhr && options . chunking . success . resetOnStatus . indexOf ( xhr . status ) >= 0 ) ) { chunked . reset ( id ) ; } if ( ! options . onAutoRetry ( id , name , normalizedResponse , xhr ) ) { upload . cleanup ( id , normalizedResponse , xhr ) ; } } ) ; }
Called when all chunks have been successfully uploaded and we want to ask the handler to perform any logic associated with closing out the file, such as combining the chunks.
Called when all chunks have been successfully uploaded and we want to ask the handler to perform any logic associated with closing out the file such as combining the chunks .